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
πŸ’¬ Discuss
βœ… Correct Answer: (D) i i i i i i i i i i

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
163
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Ram Avtar Sharma
Publisher
πŸ“ˆ
92%
Success Rate