
2D Arrays in Java Quiz
Authored by Mister Swagner
Computers
12th Grade
20 Questions
Used 3+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you declare a 2D array in Java?
`int[][] array2D;`
`int array2D[][];`
`int[2][2] array2D;`
Both A and B are correct.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is the correct way to initialize a 2D array in Java?
`int[][] array2D = new int[2][2];`
`int array2D[][] = {{1, 2}, {3, 4}};`
`int[][] array2D = {{1, 2}, {3, 4}};`
All of the above.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you access the first element in the second row of a 2D array named `array2D`?
`array2D[1][0];`
`array2D[0][1];`
`array2D[2][1];`
`array2D[1][1];`
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does `array2D.length` return for a 2D array named `array2D`?
The number of columns in the array.
The number of rows in the array.
The total number of elements in the array.
The length of the first row.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How would you iterate through all elements of a 2D array named `array2D` using a nested for loop?
`for(int i = 0; i < array2D.length; i++) { for(int j = 0; j < array2D[i].length; j++) { // access element } }`
`for(int i = 0; i < array2D.length; i++) { for(int j = 0; j < array2D.length; j++) { // access element } }`
`for(int i = 0; i < array2D[0].length; i++) { for(int j = 0; j < array2D.length; j++) { // access element } }`
`for(int i = 0; i < array2D.length; i++) { for(int j = 0; j < array2D[0].length; j++) { // access element } }`
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the correct way to pass a 2D array named `array2D` to a method in Java?
`public void processArray(int[][] array2D) { // process array }`
`public void processArray(int array2D[][]) { // process array }`
`public void processArray(int[] array2D[]) { // process array }`
All of the above.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following statements will correctly create a 2D array with 3 rows and 2 columns?
`int[][] array2D = new int[3][2];`
`int array2D[][] = new int[2][3];`
`int[] array2D = new int[3][2];`
`int[][] array2D = new int[][3];`
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
20 questions
PEMBOLEHUBAH,PEMALAR DAN JENIS DATA
Quiz
•
7th - 12th Grade
15 questions
Basics in Java
Quiz
•
9th - 12th Grade
15 questions
Pemrograman
Quiz
•
9th - 12th Grade
20 questions
NP IT Quiz ปริศนาไอที #4
Quiz
•
9th - 12th Grade
15 questions
Číselné soustavy a IP adresy
Quiz
•
11th - 12th Grade
15 questions
TÜBİTAK 4006 (FATİH İSLAM SEÇEN BİLSEM) 4
Quiz
•
3rd - 12th Grade
17 questions
12-րդ դասարան: Թեմատիկ աշխատանք: 2-րդ կիսամյակ
Quiz
•
9th - 12th Grade
15 questions
Empowerment Technologies
Quiz
•
KG - 12th Grade
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
11 questions
How well do you know your Christmas Characters?
Lesson
•
3rd Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
20 questions
How the Grinch Stole Christmas
Quiz
•
5th Grade
Discover more resources for Computers
26 questions
Christmas Movie Trivia
Lesson
•
8th Grade - Professio...
15 questions
Christmas Song Emoji Pictionary
Quiz
•
7th - 12th Grade
20 questions
Christmas Movies
Quiz
•
1st - 12th Grade
55 questions
CHS Holiday Trivia
Quiz
•
12th Grade
20 questions
Christmas Movie Trivia
Quiz
•
9th - 12th Grade
29 questions
christmas facts
Lesson
•
5th - 12th Grade
20 questions
Christmas Trivia
Quiz
•
5th - 12th Grade
20 questions
Stages of Meiosis
Quiz
•
9th - 12th Grade