Which of the following 2D Array declarations is correct? int]m1 = new int[3][3]; int00 m2; m2 = new int[3][3]; III. int[3][3] = new m3; } 1. II. Using the above - choose an answer * I only II only III only I and II only I, II, and III Which of the following 2D Array declarations is correct? 1. intm1= {1,2,3), (4,5,6); II. int]m2= {(1,2,3), (4,5,6}); III. int[m3= {{1,2,3), {4,5,6}); Using the above - Choose an answer * I only II only III only I and II only II and III only
Which of the following 2D Array declarations is correct? int]m1 = new int[3][3]; int00 m2; m2 = new int[3][3]; III. int[3][3] = new m3; } 1. II. Using the above - choose an answer * I only II only III only I and II only I, II, and III Which of the following 2D Array declarations is correct? 1. intm1= {1,2,3), (4,5,6); II. int]m2= {(1,2,3), (4,5,6}); III. int[m3= {{1,2,3), {4,5,6}); Using the above - Choose an answer * I only II only III only I and II only II and III only
Chapter9: Advanced Array Concepts
Section: Chapter Questions
Problem 9RQ
Related questions
Question
questions are in the attached pics! thanks!
![Which of the following 2D Array declarations is correct?
1. int[][] m1 = new int[3][3];
II.
int00 m2;
m2 = new int[3][3];
III. int[3][3] = new m3; }
Using the above - choose an answer *
I only
II only
III only
I and II only
I, II, and III
Which of the following 2D Array declarations is correct?
1. int[][]m1 =
{1,2,3), (4,5,6);
II. int] m2=
{{1,2,3), (4,5,6});
III. int[]] m3=
{(1,2,3),
{4,5,6});
Using the above - Choose an answer *
I only
II only
III only
I and II only
II and III only](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F13373a09-98e2-4628-97cc-1360719410b9%2F0d939b50-2695-4c36-8912-a66b947be254%2Fwuxu0k_processed.png&w=3840&q=75)
Transcribed Image Text:Which of the following 2D Array declarations is correct?
1. int[][] m1 = new int[3][3];
II.
int00 m2;
m2 = new int[3][3];
III. int[3][3] = new m3; }
Using the above - choose an answer *
I only
II only
III only
I and II only
I, II, and III
Which of the following 2D Array declarations is correct?
1. int[][]m1 =
{1,2,3), (4,5,6);
II. int] m2=
{{1,2,3), (4,5,6});
III. int[]] m3=
{(1,2,3),
{4,5,6});
Using the above - Choose an answer *
I only
II only
III only
I and II only
II and III only
![Consider the following static 2D array declaration
int[] list1 = {1,2,3);
int[] list2 = {4,5,6);
int[] list3 = (7,8,9);
int matrix = {list1,list2,list3);
What is shown by the declaration? *
O It shows a quicker way to declare a 2D static array.
O A 2D static array is an array of arrays.
O
The initializer list is the best declaration for 2D arrays.
The initializer list can only be used with int elements.
An incorrect declaration. new should be used for a declaration.
Consider the following dynamic 2D array declarations.
ArrayList<Integer> list1 = new ArrayList<Integer>();
list1.add(100);
list1.add(200);
ArrayList<Integer> list2 = new ArrayList<Integer>();
list2.add(300);
list2.add(400);
ArrayList<Integer> list3 = new ArrayList<Integer>();
list3.add(500);
list3.add(600);
ArrayList<ArrayList<Integer>> matrix = new ArrayList<ArrayList<Integer>>();
matrix.add(list1);
matrix.add(list2);
matrix.add(list3);
What is shown by the declaration above? *
O It shows a quicker way to declare a 2D static array
O A 2D dynamic array is an array of arrays.
C The initializer list is the best declaration for 2D arrays.
The initializer list can only be used with int elements.
An incorrect declaration. new should be used for a declaration.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F13373a09-98e2-4628-97cc-1360719410b9%2F0d939b50-2695-4c36-8912-a66b947be254%2F9avnd4p_processed.png&w=3840&q=75)
Transcribed Image Text:Consider the following static 2D array declaration
int[] list1 = {1,2,3);
int[] list2 = {4,5,6);
int[] list3 = (7,8,9);
int matrix = {list1,list2,list3);
What is shown by the declaration? *
O It shows a quicker way to declare a 2D static array.
O A 2D static array is an array of arrays.
O
The initializer list is the best declaration for 2D arrays.
The initializer list can only be used with int elements.
An incorrect declaration. new should be used for a declaration.
Consider the following dynamic 2D array declarations.
ArrayList<Integer> list1 = new ArrayList<Integer>();
list1.add(100);
list1.add(200);
ArrayList<Integer> list2 = new ArrayList<Integer>();
list2.add(300);
list2.add(400);
ArrayList<Integer> list3 = new ArrayList<Integer>();
list3.add(500);
list3.add(600);
ArrayList<ArrayList<Integer>> matrix = new ArrayList<ArrayList<Integer>>();
matrix.add(list1);
matrix.add(list2);
matrix.add(list3);
What is shown by the declaration above? *
O It shows a quicker way to declare a 2D static array
O A 2D dynamic array is an array of arrays.
C The initializer list is the best declaration for 2D arrays.
The initializer list can only be used with int elements.
An incorrect declaration. new should be used for a declaration.
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 4 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT