Access the array 4 java program code compile and run the


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),import java.io.*;

public class array4 //class code block
{
public static final double value1 = 25.5; //class variable

public static void main(String args[]) throws IOException //method code block of class

{

int x,y;
int max = 20;
double a,b;
int[] ints1 = new int[max]; //creates array of integers (1)

System.out.println(ints1[0]); //array elements initialized to zero
x = 25;
y = 15;
ints1[0]= x++ + y++; // (2)
System.out.println(x);
System.out.println(y);
System.out.println(ints1[0]); //value is 40 and is precedence dependent

for(int i=0;i {
ints1[i]=i+2; // (4)
System.out.println(ints1[i]);
}
System.out.println(ints1[4]+value1);

}
}

that is, what the code does syntactically and what it does in the program.

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Access the array 4 java program code compile and run the
Reference No:- TGS01251588

Now Priced at $20 (50% Discount)

Recommended (96%)

Rated (4.8/5)