A

Admin • 828.43K Points
Coach

Q. What will this code output?
char[] ch = {'A','B','C'};
System.out.print(ch[1]);

  • (A) A
  • (B) B
  • (C) C
  • (D) Index out of bounds
  • Correct Answer - Option(B)
  • Views: 16
  • Filed under category Java
  • Hashtags: Java Array

Explanation by: Admin
Index 1 refers to the second character, which is 'B'.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.