Examveda

What will be the output of the following Java snippet, if compiled and executed with command line argument "java abc 1 2 3"?
public class abc
{
   static public void main(String [] xyz)
   {
       for(int n=1;n<xyz.length; n++)
       {
          System.out.println(xyz[n]+"");
       }
   }
}

A. 1 2

B. 2 3

C. 1 2 3

D. Compilation error

Answer: Option B


This Question Belongs to Java Program >> Miscellaneous In Java

Join The Discussion

Related Questions on Miscellaneous in Java