A

Admin • 828.03K Points
Coach

Q. How do you declare a one-dimensional array in Java?

  • (A) int[] myArray;
  • (B) int myArray[];
  • (C) Array myArray;
  • (D) All of the above
  • Correct Answer - Option(A)
  • Views: 17
  • Filed under category Java
  • Hashtags:

Explanation by: Admin
In Java, a one-dimensional array is declared by specifying the type of elements followed by square brackets and then the array name. The correct syntax is:

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.