aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
Multiple choice

What will be output of the following program?

class A { 
  boolean b;
  public static void main(String arg[]){
    System.out.println(b);
  }
}

  1. compile time error

  2. true

  3. false

  4. runtime exception

  5. 0

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Compile Time Error

Keep practicing — related questions

  • What will be output of the following program? class A { static{ System.out.println("JAVA"); System.exit(0);...
  • class A { public void main(String args[]) { System.out.println("Hello World!"); } } What is the output of t...
  • What would be the output of the following program? Class A { public static void main(String args[]) { int a...
  • What will be the output of the following? public void test(){boolean x;if(x){System.out.println(false);}els...
  • What will be the output of the below code snippet? public class Quiz6 { public static void main(String[] ar...
  • What is the output for the below code ? public class Test { public static void main(String[] args) { Boolea...
  • What will be the output of the program? public class A { void A() /* Line 3 */ { System.out.println("Class ...
  • What will be the output of the given program? class MyClass { public static void main(String AR[]) { short ...

Practice this topic

  • Programming Output Evaluation (1721 questions)
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy