OOPS
August 25, 2024OOPS
August 25, 2024OOPS
|
Question 116
|
Which of the following java statement declare and allocate a 2-dimensional array integers with four rows and five columns?
|
int array[ ] [ ]=new int [5][4];
|
|
|
int array [4][5];
|
|
|
int array[5][4];
|
|
|
int array[ ] [ ]=new int[4][5];
|
Question 116 Explanation:
→ In question they are clearly mentioned that 4 rows and 5 columns.
→ Syntax int array[ ] [ ]=new int[row size][column size];
(or)
int[ ] [ ] array=new int[row size][column size];
So, Option D is correct answer.
→ Syntax int array[ ] [ ]=new int[row size][column size];
(or)
int[ ] [ ] array=new int[row size][column size];
So, Option D is correct answer.
Correct Answer: D
Question 116 Explanation:
→ In question they are clearly mentioned that 4 rows and 5 columns.
→ Syntax int array[ ] [ ]=new int[row size][column size];
(or)
int[ ] [ ] array=new int[row size][column size];
So, Option D is correct answer.
→ Syntax int array[ ] [ ]=new int[row size][column size];
(or)
int[ ] [ ] array=new int[row size][column size];
So, Option D is correct answer.
