
Java-Chapter 18 Exam
Authored by Sundi Tiller
Computers
12th Grade
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following types of data can be stored in arrays?
Primitive data types
strings
References to any kind of object
All of these can be stored in arrays
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
When the line of code below is run, what values will be stored in each of the array elements? int[] teamScores = new int[5];
0
null
false
Java doesn't define an initial value, so the contents are random
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which answer will correctly declare and initialize a 5-element array with specific numeric values?
int[] teamScores = new int(10,5,17,20,3);
int teamScores = (10,5,17,20,3);
int[] teamScores = {10,5,17,20,3};
int[] teamScores = new int[10,5,17,20,3];
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What are the minimum and maximum valid array index values for a 5-element array?
0 and 5
0 and 4
1 and 4
1 and 5
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Given the code below, which statement will correctly set the very first array element equal to 10? int[] teamScores = new int[5];
teamScores(1) = 10;
teamScores[0] = 10;
teamScores[10] = 0;
teamScores = 10;
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
If the Score class has been defined, how many unique Score objects are created by the following code?
Score[] teamScores = new Score[4];
teamScores[0] = new Score();
teamScores[1] = new Score();
teamScores[2] = teamScores[1];
1
3
2
4
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
If the Score class has been defined, what phrases should replace the ??? marks to set up a standard for() loop to iterate over the entire array?
Score[] teamScores = new Score[4];
for (???)
{
teamScores[i] = new Score();
}
int i=1; i<teamScores.length- 1; i++
int i=0; i<=teamScores.length; i++
int i=1; i<=teamScores.length-1; i++
int i=0; i<teamScores.length; i++
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
16 questions
A2 Computer Science 4.10 Databases
Quiz
•
10th - 12th Grade
15 questions
Digital Etiquette
Quiz
•
4th Grade - University
15 questions
python basics
Quiz
•
11th Grade - University
15 questions
Code Combat Curso Junior
Quiz
•
9th - 12th Grade
15 questions
KKHP Roblox Game Development Quiz
Quiz
•
4th - 12th Grade
15 questions
CIW
Quiz
•
9th - 12th Grade
16 questions
C-Programming Basics
Quiz
•
12th Grade
20 questions
Microsoft Excel
Quiz
•
KG - Professional Dev...
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