
Multiple-Choice Quiz on Java Arrays

Quiz
•
Other
•
University
•
Medium
Robin Arcilla
Used 5+ times
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
What is the length of the following array: byte[] data = { 12, 34, 9, 0, -62, 88 };
5
6
7
8
2.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
What is the output of the following code fragment? int[] egArray = { 2, 4, 6, 8, 10, 1, 3, 5, 7, 9 }; for (int index = 0; index < 5; index++) System.out.print(egArray[index] + " ");
2 4 6 8 10
2 4 6 8 1
2 4 6 8 0
2 4 6 8
3.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
What is the output of the following code fragment? int[] egArray = { 2, 4, 6, 8, 10, 1, 3, 5, 7, 9 }; for (int index = 0; index < egArray.length; index++) System.out.print(egArray[index] + " ");
2 4 6 8 10 1 3 5 7 9
2 4 6 8 1 3 5 7 9
2 4 6 8 10
2 4 6 8
4.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
What is the output of the following code fragment? int[] egArray = { 2, 4, 6, 8, 10, 1, 3, 5, 7, 9 }; for (int index = 0; index < egArray.length; index = index + 2) System.out.print(egArray[index] + " ");
2 6 10 3 7
2 8 10 5 9
2 6 10 7
2 8 3 7
5.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
Examine the following program fragment: int[] array = { 1, 4, 3, 6, 8, 2, 5 }; int what = array[0]; for (int index = 0; index < array.length; index++) { if (array[index] > what) what = array[index]; } System.out.println(what); What does the fragment write to the monitor?
1
5
8
6
6.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
Examine the following program fragment: int[] array = { 1, 4, 3, 6, 8, 2, 5 }; int what = array[0]; for (int index = 0; index < array.length; index++) { if (array[index] < what) what = array[index]; } System.out.println(what); What does the fragment write to the monitor?
1
5
8
0
7.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
Examine the following program fragment: int[] array = { 1, 4, 3, 6 }; int what = 0; for (int index = 0; index < array.length; index++) { what = what + array[index]; } System.out.println(what); What does the fragment write to the monitor?
10
11
14
15
Create a free account and access millions of resources
Similar Resources on Wayground
19 questions
Chopin i Mozart

Quiz
•
KG - Professional Dev...
10 questions
Java Quiz

Quiz
•
University
20 questions
CodeMavarick

Quiz
•
University
20 questions
UAS Algoritma dan Pemrograman

Quiz
•
University
12 questions
Archivos en JAVA

Quiz
•
University
17 questions
Basics of Programming with C

Quiz
•
University
20 questions
Round 3

Quiz
•
University
20 questions
Java Debugging Questions - H

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Other
10 questions
Would you rather...

Quiz
•
KG - University
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
10 questions
The Constitution, the Articles, and Federalism Crash Course US History

Interactive video
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
16 questions
Water Modeling Activity

Lesson
•
11th Grade - University
10 questions
ACT English prep

Quiz
•
9th Grade - University