A

Admin • 37.06K Points
Coach

Q. What will be the output of the following Java program, if we run as "java main_arguments 1 2 3"?
class main_arguments
{
public static void main(String [] args)
{
String [][] argument = new String[2][2];
int x;
argument[0] = args;
x = argument[0].length;
for (int y = 0; y < x; y++)
System.out.print(" " + argument[0][y]);
}
}

  • (A) 1 1
  • (B) 1 0
  • (C) 1 0 3
  • (D) 1 2 3
  • Correct Answer - Option(D)
  • Views: 10
  • Filed under category JAVA

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.


Question analytics