can anyone tell me which is the answer,
What gets printed when the following code is compiled and run with the following arguments -
java test 2
Select the one correct answers.
public class test() {
public static void main(
String args[]) {
Integer intObj = Integer.valueOf(args[args.length - 1]);
int i = intObj.intValue();
if(args.length > 1)
System.out.println(i);
if(args.length > 0)
System.out.println(i - 1);
else
System.out.println(i - 2);
}
}
a. test
b. test-1
c. 0
d. 1
e. 2.
thanks in advance