
Multiple-Choice Quiz on Java Arrays
Quiz
•
Other
•
University
•
Practice Problem
•
Medium
Robin Arcilla
Used 5+ times
FREE Resource
Enhance your content in a minute
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
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
IDA in pregnancy
Quiz
•
University
10 questions
M2002B_WATER JET
Quiz
•
University
14 questions
Prueba de Entrada Control Estadístico de Procesos
Quiz
•
University
15 questions
UAS PBE
Quiz
•
University
20 questions
Quiz despre Hardware si Memorie
Quiz
•
9th Grade - University
20 questions
Quiz Seminar Perpajakan Tax Center
Quiz
•
University
20 questions
Electrical Science Cat 3 DMEL 245
Quiz
•
University
16 questions
2.1 Analizando las causas para el desarrollo de un CMI.
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
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
20 questions
Figurative Language Review
Quiz
•
6th Grade
Discover more resources for Other
12 questions
IREAD Week 4 - Review
Quiz
•
3rd Grade - University
23 questions
Subject Verb Agreement
Quiz
•
9th Grade - University
7 questions
Force and Motion
Interactive video
•
4th Grade - University
7 questions
Renewable and Nonrenewable Resources
Interactive video
•
4th Grade - University
5 questions
Poetry Interpretation
Interactive video
•
4th Grade - University
19 questions
Black History Month Trivia
Quiz
•
6th Grade - Professio...
15 questions
Review1
Quiz
•
University
15 questions
Pre1
Quiz
•
University
