A

Admin • 828.43K 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;
  • Correct Answer - Option(A)
  • Views: 14
  • Filed under category Java
  • Hashtags: Java Array

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.