Given: Student [] students = new Student[25]
How would you access the instance variable, name, for the first student?
Java Arrays
Quiz
•
Mathematics
•
8th Grade
•
Medium
Anne Kohart
Used 9+ times
FREE Resource
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
10 questions
Scatterplots & Predictions
Quiz
•
7th - 9th Grade
12 questions
Proportion Word Problems
Quiz
•
7th - 8th Grade
10 questions
Geometry Academic Vocabulary
Quiz
•
4th Grade - University
12 questions
Python Basics
Quiz
•
8th - 12th Grade
8 questions
Robotics Quiz
Quiz
•
1st - 12th Grade
10 questions
Intro to Python
Quiz
•
KG - University
10 questions
GRAPHING USING INTERCEPTS
Quiz
•
8th Grade
10 questions
Standard Form Linear Equations
Quiz
•
8th - 9th Grade
25 questions
Equations of Circles
Quiz
•
10th - 11th Grade
30 questions
Week 5 Memory Builder 1 (Multiplication and Division Facts)
Quiz
•
9th Grade
33 questions
Unit 3 Summative - Summer School: Immune System
Quiz
•
10th Grade
10 questions
Writing and Identifying Ratios Practice
Quiz
•
5th - 6th Grade
36 questions
Prime and Composite Numbers
Quiz
•
5th Grade
14 questions
Exterior and Interior angles of Polygons
Quiz
•
8th Grade
37 questions
Camp Re-cap Week 1 (no regression)
Quiz
•
9th - 12th Grade
46 questions
Biology Semester 1 Review
Quiz
•
10th Grade