Help please, what is the "args[]" here in the loop?
The answer is 5. Why?
15.Given
public class
Test {
static int i,j,k=3;
Test() {
++i;
j++;
++k;
}
public static void main(
String[] args)
{
Test t1 = new Test();
String[] s1 = new String[] {"Java", "JavaScript"};
String[] s2 = new String[] {"JSP", "Servlets"};
String[] s3 = new String[] {"ASP", "SAP"};
s1=s2;
s2=s3;
for(i= --i, j=j, k=k; k < args.length ; i++, ++j, k++)
{
System.out.println(s1[i] + "," + s2[j] + "," + s3[k] );
}
System.out.println(args[i] + � � + args[j]);
}
}
What is the result of typing �
java Test Java
JSP ASP� in the command line?
1.Compile-time error occurs.
2. Prints JSP ASP
3.Throws RuntimeException, java.lang.ArrayIndexOutOfBoundsException.
4.Prints Java JSP ASP
5.Prints Java JSP
6. None of the above.