Consider the following class :
public class Test{ public static void main (String [] args){ if (args [0].equals ("open")) if (args [1].equals ("someone")) System.out.println ("Hello!"); else System.out.println ("Go away "+ args [1]); } }
Which of the following statements are true if the above program is run with the command line:
java Test closed
Select 1 option
Correct Option is : B
Both the outer if statement and the inner if statement might conceivably own the else clause.
In this example, one might be tempted to assume that the programmer intended the else clause to belong to the outer if statement.