
Unit 9 2D Arrays Practice 1

Quiz
•
Computers
•
11th Grade
•
Easy
John Schlamann
Used 4+ times
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is the correct way to declare a 2D array in Java?
int[][] array = new int[3][3];
int array = new int[3,3];
int array[3][3];
int[][] array = {3,3};
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you access the element in the second row and third column of a 2D array named `matrix`?
matrix[2][3]
matrix[1][2]
matrix[3][2]
matrix[2][1]
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code snippet?
int[][] array = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}; System.out.println(array[0][2]);
1
2
3
6
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following correctly initializes a 2D array with 2 rows and 3 columns?
int[][] array = new int[2][3];
int[][] array = new int[3][2];
int[][] array = new int[2,3];
int[][] array = new int[3][3];
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the following code: ```java int[][] matrix = new int[3][3]; matrix[0][0] = 5; ``` What is the value of `matrix[0][0]` after execution?
0
5
null
undefined
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following statements is true about nested arrays in Java?
All rows in a 2D array must have the same number of columns.
Each row in a 2D array can have a different number of columns.
A 2D array cannot contain other arrays.
A 2D array must be square (same number of rows and columns).
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the result of the following code? int[][] array = {{1, 2}, {3, 4, 5}, {6}}; System.out.println(array[1][2]);
3
4
5
ArrayIndexOutOfBoundsException
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
Introduction to Arrays

Quiz
•
KG - University
10 questions
Arrays

Quiz
•
11th Grade
14 questions
Exploring Computer Science

Quiz
•
10th - 12th Grade
19 questions
Unit 5 - Two-Dimensional Arrays

Quiz
•
9th - 12th Grade
10 questions
identify the appropriate data structure

Quiz
•
11th Grade
10 questions
Kuis Array 1

Quiz
•
11th Grade
15 questions
2D Arrays

Quiz
•
9th - 12th Grade
10 questions
Arrays

Quiz
•
10th - 12th Grade
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
20 questions
Digital Citizenship

Quiz
•
8th - 12th Grade
35 questions
Computer Baseline Examination 2025-26

Quiz
•
9th - 12th Grade
13 questions
Problem Solving Process

Quiz
•
9th - 12th Grade
10 questions
Understanding Algorithms with Pseudocode and Flowcharts

Interactive video
•
9th - 12th Grade
19 questions
AP CSP Unit 1 Review (code.org)

Quiz
•
10th - 12th Grade