What will be the output of the program?


			  		

Loading

Choose the correct option.

What will be the output of the program?

boolean bool = true;  
if(bool = false) /* Line 2 */ {
System.out.println("a");
} else if(bool) /* Line 4 */ {
System.out.println("b");
} else if(!bool) /* Line 6 */ {
System.out.println("c"); /* Line 7 */
} else {
System.out.println("d");
}

 

A. a
B. b
C. c
D. d

Leave a Comment