Given: 1. class Comp2 { 2. public static void main(String[] args) { 3. float f1 = 2.3f; 4. float[][] f2 = {{42.Of}, {l.7f, 2.3f}, {2.6f, 2.7f}}; 5. float[] f3 = {2.7f}; 6. Long x = 42L; 7. // insert code here 8. System.out.println("true"); 9. } 10. } And the following five code fragments: F1. if (f1 == f2) F2. if (f1 == f2[2][1]) F3. if (x == f2[0][0]) F4. if (f1 == f2 [1,1]) F5. if (f3 == f2 [2]) What is true?

  1. One of them will compile, only one will be true.

  2. Two of them will compile, only one will be true.

  3. Two of them will compile, two will be true.

  4. Three of them will compile, only one will be true

  5. Three of them will compile, exactly two will be true.

  6. Three of them will compile, exactly three will be true.


Correct Option: D

Find more quizzes: