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
πŸ’¬ Discuss
βœ… Correct Answer: (B) Prints false
Explanation: By default, a boolean variable will contain false.
Explanation by: Priyanka Tomar
By default, a boolean variable will contain false.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
126
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Priyanka Tomar
Publisher
πŸ“ˆ
86%
Success Rate