2D Arrays

2D Arrays

University

5 Qs

quiz-placeholder

Similar activities

Mastering Java 2D Arrays Quiz

Mastering Java 2D Arrays Quiz

2D Arrays in Java Quiz

2D Arrays in Java Quiz

2d array Java

2d array Java

2 D Arrays

2 D Arrays

JAVA ARRAYS

JAVA ARRAYS

APCS - 2D Array  Packet

APCS - 2D Array Packet

2D Arrays

2D Arrays

Assessment

Quiz

Computers

University

Practice Problem

Easy

Created by

Alicia McNett

Used 3+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

5 questions

Show all answers

1.

FILL IN THE BLANK QUESTION

1 min • 1 pt

Complete this code for a 2D array: int[][] temps = ___ int[5][2];

2.

FILL IN THE BLANK QUESTION

1 min • 1 pt

Complete this for loop code to loop until the end of an array called "grades":

for(int row = 0; row < ___ ; row++) ...

3.

FILL IN THE BLANK QUESTION

1 min • 1 pt

What is missing below order to declare the array as a 3D array:

int[][]___ multiArray;

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In 2D arrays, each row must be the same length (e.g. 2D arrays cannot be ragged/jagged).

True

False

Answer explanation

In a 2D array, each row contains an array that consists of the columns. There is nothing stopping a 2D array from having rows of different sizes.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What value prints below?

int[][] vals = { { 1, 2 }, { 3, 4 } };

 

        System.out.println(vals[0][1]);

1

2

3

4

Answer explanation

The first subscript value (0) means "first row".

The second subscript value (1) means "second column" of that row.

Don't forget that index values start at 0.