What will be the result of attempting to compile and run the following class?.
public class Main { public static void main(String[] args) { if (true) if (false) System.out.println("a"); else System.out.println("b"); } }
Select the one correct answer.
(d)
The program will display the letter b when run.
The second if statement is evaluated since the boolean expression of the first if statement is true.
The else clause belongs to the second if statement.
Since the boolean expression of the second if statement is false, the if block is skipped and the else clause is executed.