Java - What is the output: boolean instanceof

What is the output of the following code?

Description

What is the output of the following code?


public class Main{

  public static void main(String[] args) {
    boolean b = true;
    System.out.println(b instanceof Boolean);
  }
}


Click to view the answer

Compile time error

Note

boolean is not a type, it is a keyword. Boolean is a type

bool is a boolean (value), not a reference.

It cannot be the first argument of instanceof.

Related Topic