Explore BrainMass

Access the array 4 Java program

Access the array 4 Java program. Code, compile, and run the program. There are four lines of code marked (1)..(4) that you must explain after analyzing the code, running the program, and examining the output. Post to the Answer Forum an explaination of each of the lines of code (1..4), that is, what the code does syntactically and what it does in the program.


Solution Preview

Here is the explaination of the lines. I also included it in the attached file
Line 1:
int[] ints1 = new int[max]; //(1)creates array of integers whose size is the value of max(20 in this case); array elements initialized to zero (1)

Line 2:
ints1[0]= x++ + y++; // (2) assign the value of x+y to intsl[0], the array element whose idex is 0. then increase the value of x by 1, and increase the ...

Solution Summary

This job accesses the array 4 Java program.