Java Arrays

Java Arrays

8th Grade

7 Qs

quiz-placeholder

Similar activities

Circles Quiz (Parts, Area and Circumference)

Circles Quiz (Parts, Area and Circumference)

6th - 9th Grade

12 Qs

Ch. 3 Review

Ch. 3 Review

8th - 12th Grade

11 Qs

Ratios and Proportion: Maps and Scales (Basic)

Ratios and Proportion: Maps and Scales (Basic)

7th - 8th Grade

10 Qs

2018 TEACH Academy Quiz

2018 TEACH Academy Quiz

4th - 8th Grade

11 Qs

Angles in Parallel Lines & Polygons Quiz

Angles in Parallel Lines & Polygons Quiz

8th - 12th Grade

10 Qs

Metric Length Conversion

Metric Length Conversion

5th - 8th Grade

11 Qs

Squares and Square Roots

Squares and Square Roots

8th Grade

10 Qs

8G Math CW#20: Lesson 8.2 and 9.5

8G Math CW#20: Lesson 8.2 and 9.5

8th Grade

12 Qs

Java Arrays

Java Arrays

Assessment

Quiz

Mathematics

8th Grade

Practice Problem

Medium

Created by

Anne Kohart

Used 9+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?