What will be the output of the program?


			  		

Loading

Choose the correct option.

What will be the output of the program?

public class ArrayTest {     
public static void main(String[ ] args) {
float f1[ ], f2[ ];
f1 = new float[10];
f2 = f1;
System.out.println("f2[0] = " + f2[0]);
}
}

 

A. It prints f2[0] = 0.0
B. It prints f2[0] = NaN
C. An error at f2 = f1; causes compile to fail.
D. It prints the garbage value.

Leave a Comment