Given the following,
import java.awt.Button;
class CompareReference {
public static void main (
String [] args){
float f = 42.0f;
float [] f1 = new float[2];
float [] f2 = new float[2];
float [] f3 = f1;
long x = 42;
f1[0] = 42.0f;
}
}
which three statements are true? (Choose three)
A. f1 == f2
B. f1 == f3
C. f2 == f1[1]
D. x == f1[0]
E. f == f1[0]
The answers are B,D and E.
The question is why D, that is why you are allow to compare a long with a float?