A

Admin • 828.03K Points
Coach

Q. Which of the following is a correct way to declare an array in Java?

  • (A) int arr[] = new int[5];
  • (B) array int arr = new array[5];
  • (C) int arr = new int(5);
  • (D) int[5] arr;

Explanation by: Admin
Option A is the correct syntax for declaring and allocating a Java array.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.