P

Priyanka Tomar • 35.28K Points
Coach

Q. The following program:
public class Test{
static boolean isOK;
public static void main(String args[]){
System.out.print(isOK);
}
}

  • (A) Prints true
  • (B) Prints false
  • (C) Will not compile as boolean is not initialized
  • (D) Will not compile as boolean can never be static
  • Correct Answer - Option(B)
  • Views: 51
  • Filed under category JAVA

Explanation by: Priyanka Tomar
By default, a boolean variable will contain false.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.


Question analytics