posted 15 years ago
And the following five code fragments:
F1. if(f1 == f2) // not compile, f1 is float while f2 is object
F2. if(f1 == f2[2][1]) // compile but not true, f1=2.3 while f2[2][1]=2.7
F3. if(x == f2[0][0]) // compile and true, 42L==42.0f results in true
F4. if(f1 == f2[1,1]) // not compile, wrong syntax (comma not allowed on array index)
F5. if(f3 == f2[2]) // compile but not true, f3={2.7f} while f2[2]={2.6f, 2.7f}
Meghna, the == operator can compare numeric values (unboxing the Long to long and then comparing to a float).
Greetings.