+1 vote
in Data Structures & Algorithms I by (110k points)
Which of the following is the correct way to declare a multidimensional array in Java?

(a) int[] arr;

(b) int arr[[]];

(c) int[][]arr;

(d) int[[]] arr;

This intriguing question originated from Array and Array Operations in portion Abstract Data Types of Data Structures & Algorithms I

I got this question in examination.

1 Answer

+1 vote
by (412k points)
selected by
 
Best answer
The correct choice is (c) int[][]arr;

To explain: The syntax to declare multidimensional array in java is either int[][] arr; or int arr[][];

Related questions

Welcome to TalkJarvis QnA, a question-answer community website for the people by the people. On TalkJarvis QnA you can ask your doubts, curiosity, questions and whatever going in your mind either related to studies or others. Experts and people from different fields will answer.

Categories

...