
Unit 9 2D Arrays Practice 1
Authored by John Schlamann
Computers
11th Grade
Used 4+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
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
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
KEIRO PROGRAMMING
Quiz
•
4th - 12th Grade
20 questions
KELAS 7 1
Quiz
•
9th - 12th Grade
15 questions
1.1.1 The structure and function of the processor
Quiz
•
11th Grade - University
20 questions
Network topologies
Quiz
•
8th Grade - University
15 questions
Data Security Worksheet
Quiz
•
10th Grade - University
20 questions
2324tx6
Quiz
•
9th - 12th Grade
20 questions
QUIZ BAB 4: SISTEM OPERASI
Quiz
•
8th Grade - University
13 questions
Guess the Retro Computer 1
Quiz
•
KG - Professional Dev...
Popular Resources on Wayground
7 questions
History of Valentine's Day
Interactive video
•
4th Grade
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
15 questions
Valentine's Day Trivia
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
Discover more resources for Computers
18 questions
Valentines Day Trivia
Quiz
•
3rd Grade - University
20 questions
-AR -ER -IR present tense
Quiz
•
10th - 12th Grade
21 questions
Presidents Day Trivia
Quiz
•
6th - 12th Grade
10 questions
Valentine's Day: History and Modern Celebration
Interactive video
•
9th - 12th Grade
11 questions
Valentine's Day Trivia
Quiz
•
8th - 12th Grade
10 questions
Factor Quadratic Expressions with Various Coefficients
Quiz
•
9th - 12th Grade
10 questions
Evaluating Piecewise Functions Practice
Quiz
•
11th Grade
18 questions
Success Strategies
Quiz
•
9th - 12th Grade