A

Admin • 828.03K Points
Coach

Q. What is the output?
int[] arr = {1,2,3};
for(int i : arr) {
System.out.print(i + " ");
}

  • (A) 123
  • (B) 1 2 3
  • (C) i i i
  • (D) error

Explanation by: Admin
for-each prints each element separated by space.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.