Java Arrays
Quiz
•
Mathematics
•
8th Grade
•
Practice Problem
•
Medium
Anne Kohart
Used 9+ times
FREE Resource
Enhance your content in a minute
7 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Given: Student [] students = new Student[25]
How would you access the instance variable, name, for the first student?
String n = students.getName()
String n = students[0].getName();
Student s = students.getName();
String n = students.getName(0);
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Given String [] words = new String[20];
How many words are in the array?
19
20
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Shifting array (called arr) elements to the right.... your for loop should start with:
for (int i = arr.length -1;
for (int i = 0;
for (int i = arr.length;
for (int i = arr.length();
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Given String [] words = new String[don't know];
Which line of code gives you how many words are in the words array?
words.length()
words.length
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Given String [] words = new String[don't know];
Which line of code gives you the length of the first word in the words array?
words[0].length
words[0].length()
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
When shifting elements of an array called arr, to the left, you should use:
arr[i] = arr[i+1];
arr[i] = array[i-1];
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Given String [] words = {"cat", "kitten", "Lil Chef"}
What prints out ?
System.out.println(words[words.length - 1].indexOf("t");
0
1
2
-1
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
Area and Perimeter of Composite Shapes Grade 8 Final
Quiz
•
7th - 8th Grade
10 questions
KSSM CH1: Pattern and Sequences F2
Quiz
•
7th - 9th Grade
10 questions
Independent and Dependent Variables
Quiz
•
6th - 8th Grade
10 questions
Arc Length and Perimeter of a SECTOR
Quiz
•
8th - 10th Grade
10 questions
Quiz 4: Lesson 2.1.1 - 2.1.3
Quiz
•
8th Grade
10 questions
Drill/Recall Undefined terms
Quiz
•
6th - 8th Grade
10 questions
multiply polynomials
Quiz
•
8th - 12th Grade
10 questions
Week 3 Q3 Warm-Up Quiz
Quiz
•
6th - 8th Grade
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 Mathematics
15 questions
Product of Powers Property A1 U7
Quiz
•
8th Grade
20 questions
Laws of Exponents
Quiz
•
8th Grade
16 questions
8th U5L5 Graphs of Functions
Quiz
•
8th Grade
20 questions
Graphing Inequalities on a Number Line
Quiz
•
6th - 9th Grade
20 questions
Exponent Rules Review
Quiz
•
8th - 9th Grade
20 questions
One Step equations addition and subtraction
Quiz
•
5th - 8th Grade
20 questions
Translations
Quiz
•
8th Grade
25 questions
Complementary and Supplementary Angles
Quiz
•
7th - 10th Grade
