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

1 thought on “What will be the output of the following Java snippet, if compiled and executed with command line argument “java abc 1 2 3”?”

Leave a Comment