-
What is the output of following block of program ? boolean var = false; if(var = true) { System.out.println("TRUE"); } else { System.out.println("FALSE"); }(a) TRUE (b) FALSE (c) Compilation Error (d) Run-time Error
(a) EXPLANATION: The code compiles and runs fine and the 'if' test succeeds because 'var' is set to 'true' (rather than tested for 'true') in the 'if' argument.