
Arrays
Authored by Jose Diaz
Computers
1st Grade
Used 5+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
9 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
Please select 1 option.
for(String[] row : table){
System.out.print(row[row.length]);
}
int i = 0;
for(String[] col : table){
i++;
if(i==col.length){
System.out.print(table[col.length][i]);
}
}
for(var row : table){
System.out.print(row[row.length-1]);
}
for(int i=0; i<table.length-1; i++){
int j = table[i].length-1;
System.out.print(table[i][j]);
}
2.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
Please select 1 option.
The code will print i = 1 iArr[0] = 1
The code will print i = 1 iArr[0] = 2
The code will print i = 2 iArr[0] = 1
The code will print i = 2 iArr[0] = 2
The code will not compile.
3.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
Please select 1 option.
111
222
It will not compile as bA[0] is uninitialized.
It will throw an exception at runtime.
None of the above.
4.
MULTIPLE SELECT QUESTION
3 mins • 1 pt
Which of the following is/are valid instantiations and initializations of a multi dimensional array?. Please select 2 options.
var array2D = { { 0, 1, 2, 4}, {5, 6}}
int[][][] array3D = {{0, 1}, {2, 3}, {4, 5}};
int[] array2D[] = new int [2] [2];
array2D[0] [0] = 1;
array2D[0] [1] = 2;
array2D[1] [0] = 3;
int[][] array2D = new int[][]{0, 1};
int[] arr = {1, 2};
int[][] arr2 = {arr, {1, 2}, arr};
int[][][] arr3 = {arr2};
5.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
Please select 1 option.
It will throw an ArrayIndexOutOfBoundsException at Runtime.
It will throw a NullPointerException at Runtime.
It will compile and run without throwing any exceptions
It will compile and throw a NullPointerException at runtime if var ia[][] = { {1, 2}, null }; is replaced with var ia = new int[][]{ {1, 2}, null };.
It will compile and throw a NullPointerException at runtime if var ia[][] = { {1, 2}, null }; is replaced with var ia[][] = new int[][]{ {1, 2}, null };.
6.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
Please select 1 option.
It will throw NullPointerBoundsException.
It will throw ArrayIndexOutOfBoundsException.
It will print null.
It will run without any error but will print nothing.
None of the above.
7.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
Please select 1 option.
The program will fail to compile, because of uninitialized variable 'bool'.
The program will throw a java.lang.NullPointerException when run.
The program will print "0 null false".
The program will print "0 null true".
The program will print null and false but will print junk value for ia[0].
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
9 questions
python基础知识练习
Quiz
•
1st Grade
10 questions
Avaliação Pensamento Computacional - Prático
Quiz
•
1st Grade - Professio...
7 questions
SCR1 Recap Day 2
Quiz
•
1st Grade
10 questions
Contest of champions
Quiz
•
1st Grade - Professio...
12 questions
Arduino
Quiz
•
1st - 3rd Grade
10 questions
What is the Icon?
Quiz
•
KG - 12th Grade
10 questions
Mechanical systems
Quiz
•
1st - 2nd Grade
8 questions
Grade 1 Paint Program
Quiz
•
1st Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
10 questions
Probability Practice
Quiz
•
4th Grade
15 questions
Probability on Number LIne
Quiz
•
4th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
6 questions
Appropriate Chromebook Usage
Lesson
•
7th Grade
10 questions
Greek Bases tele and phon
Quiz
•
6th - 8th Grade
Discover more resources for Computers
12 questions
Presidents' Day
Quiz
•
KG - 5th Grade
20 questions
Telling Time to the Hour and Half hour
Quiz
•
1st Grade
10 questions
Exploring Rosa Parks and Black History Month
Interactive video
•
1st - 5th Grade
16 questions
Morning Math Review
Lesson
•
1st - 5th Grade
17 questions
Reading Comprehension
Quiz
•
1st - 4th Grade
16 questions
3D shapes (1st grade)
Quiz
•
1st Grade
20 questions
Place Value
Quiz
•
KG - 3rd Grade
6 questions
President's Day
Lesson
•
1st Grade