JAVA Programming :: Objects and Classes - Discussion
Home > JAVA Programming > Objects and Classes > MCQs Questions Discussion
28 / 30
Choose the correct option.
What gets printed when the following code is compiled and run with the following command –
java test 2
Select the one correct answer.
public class test {
public static void main(String args[]) {
Integer intObj=Integer.valueOf(args[args.length–1]);
inti = 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
Answer: Option (Login/Signup)
Show Explanation