Java OCA OCP Practice Question 2381

Question

What is true about the following lines of code?

boolean b = false; 
int i = 90; 
System.out.println(i >= b); 
  • a Code prints true
  • b Code prints false
  • c Code prints 90 >= false
  • d Compilation error


d

Note

The code will fail to compile; hence, it can't execute.

You can't compare incomparable types, such as a boolean value with a number.




PreviousNext

Related