Hi All,
What gets printed on the standard output when the class below is compiled and executed by entering "java
test lets see what happens". Select the one correct answer.
public class test {
public static void main(
String args[]) {
System.out.println(args[0]+" "+args[args.length-1]);
}
}
A.The program will throw an ArrayIndexOutOfBounds exception.
B.The program will print "java test"
C.The program will print "java happens";
D.The program will print "test happens"
E.The program will print "lets happens"
The correct answer is E. I don't understand why ? I think it's C. Please can anybody explain, why it is E.
Thanks.