Java Arrays

Java Arrays

8th Grade

7 Qs

quiz-placeholder

Similar activities

x and y intercepts

x and y intercepts

8th - 10th Grade

12 Qs

LCI-Linear Equations in Standard Form

LCI-Linear Equations in Standard Form

8th - 9th Grade

12 Qs

Key Attributes of Functions Quiz

Key Attributes of Functions Quiz

8th - 9th Grade

10 Qs

IDT S1 Final Review Part 2

IDT S1 Final Review Part 2

8th - 12th Grade

10 Qs

C++ Coding Problems

C++ Coding Problems

4th Grade - Professional Development

10 Qs

Ôn tập Xâu Tệp Chương Trình Con

Ôn tập Xâu Tệp Chương Trình Con

KG - 12th Grade

10 Qs

Variables Warm Up

Variables Warm Up

6th - 8th Grade

10 Qs

MathCounts - General Math

MathCounts - General Math

6th - 8th Grade

10 Qs

Java Arrays

Java Arrays

Assessment

Quiz

Mathematics

8th Grade

Medium

Created by

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