
2D Arrays
Quiz
•
Computers
•
11th Grade - University
•
Practice Problem
•
Medium
Used 49+ times
FREE Resource
Enhance your content in a minute
6 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Examine the following:
double[][] values =
{ {1.2, 9.0, 3.2},
{9.2, 0.5, -1.2},
{7.3, 7.9, 4.8} } ;
what is in values[2][1] ?
7.9
9.2
7.3
0.5
2.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Given the following:
double[][] things =
{ {1.2, 9.0, 8.7, 1.0},
{9.2, 0.5, 0.0, 5.2},
{7.3, 7.9, 1.2, 3.9} } ;
What is the value of things.length ?
4
3
12
7
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Given the following:
long [][] stuff ;
Which of the following statements constructs an array with 5 rows of 7 columns each and assign its reference to stuff ?
stuff = new stuff[5][7] ;
stuff = new long[5][7] ;
stuff = long[5][7] ;
stuff = long[7][5] ;
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
int[][] items =
{ {0, 1, 3, 4},
{4, 3, 99, 0},
{3, 2, 7, 70} } ;
items[ 99 ] = 77;
items[2][1] = 77;
items[1][2] = 77;
items[2][3] = 77;
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following constructs and assigns to array a 2D array with 7 rows, but does not yet construct the rows?
int[][] array = new int[7];
int[][] array = new int[][7];
int[][] array = new int[7][];
int[] array[7] = new int[];
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Given:
int[][] items =
{ {0, 1, 3, 4},
{4, 3, 99, 0},
{3, 2, 7, 70} } ;
Which of the following fragments prints out every element of items?
for ( int row=0; row < items.length; row++ )
{
System.out.println();
for ( int col=0; col < items.length; col++ )
System.out.print( items[row][col] + " ");
}
for ( int row=0; row < items.length; row++ )
{
System.out.println();
for ( int col=0; col < items[col].length; col++ )
System.out.print( items[row][col] + " ");
}
for ( int row=0; row < items.length; row++ )
{
for ( int row=0; row < items[row].length; row++ )
System.out.print( items[row][col] + " ");
System.out.println();
}
for ( int row=0; row < items.length; row++ )
{
System.out.println();
for ( int col=0; col < items[row].length; col++ )
System.out.print( items[row][col] + " ");
}
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
Amazon Aptitude Quiz-SK-1
Quiz
•
University
10 questions
TOOLS FOR AD & TECHNOLOGY DEVELOPMENT (W4-W6)
Quiz
•
University
10 questions
Khởi động
Quiz
•
9th - 12th Grade
10 questions
03 - Određivanje kardinaliteta
Quiz
•
University
10 questions
Flutter Quiz
Quiz
•
University
10 questions
Ôn tập chủ đề 5. Giải quyết vấn đề với sự trợ giúp của máy tính
Quiz
•
12th Grade
10 questions
Logika Fuzzy
Quiz
•
University
10 questions
Quiz 1
Quiz
•
University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
