Java Arrays

Java Arrays

8th Grade

7 Qs

quiz-placeholder

Similar activities

Q2 - MATH8 (CER PRACTICE)

Q2 - MATH8 (CER PRACTICE)

8th Grade

12 Qs

Mathematic Revision

Mathematic Revision

6th - 9th Grade

12 Qs

PERIMETER & AREA REVIEW - T1W8

PERIMETER & AREA REVIEW - T1W8

5th Grade - University

10 Qs

Perimeter Revision 1

Perimeter Revision 1

5th - 8th Grade

10 Qs

significant figures, powers and standard form unit test

significant figures, powers and standard form unit test

7th - 8th Grade

10 Qs

Area Starter W17

Area Starter W17

8th Grade

12 Qs

Intercepts

Intercepts

8th Grade

10 Qs

linear equations in one variable

linear equations in one variable

8th Grade

10 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?