A

Admin • 833K Points
Coach

Q. What is output of the following code

Code:
public class Test{
public static void main(String[] args){
int[] x = {120, 200, 016 };
for(int i = 0; i < x.length; i++)
System.out.print(x[i] + " ");
}
}
  • (A) 120 200 16
  • (B) 120 200 14
  • (C) 120 200 016
  • (D) 016 is a compile error. It should be written as 16.
  • Correct Answer - Option(B)
  • Views: 19
  • Filed under category Java
  • Hashtags:

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.

Be the first to start discuss.