A

Admin • 830.13K Points
Coach

Q. What will be the output of the following Java code?
class array_output
{
public static void main(String args[])
{
char array_variable [] = new char[10];
for (int i = 0; i < 10; ++i)
{
array_variable[i] = 'i';
System.out.print(array_variable[i] + "");
}
}
}

  • (A) 1 2 3 4 5 6 7 8 9 10
  • (B) 0 1 2 3 4 5 6 7 8 9 10
  • (C) i j k l m n o p q r
  • (D) i i i i i i i i i i
  • Correct Answer - Option(D)
  • Views: 12
  • 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.