1.

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 II got this question in examination.

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[][];



Discussion

No Comment Found

Related InterviewSolutions