ArrayList Practice Questions

ArrayList Practice Questions

11th Grade

18 Qs

quiz-placeholder

Similar activities

Ultimate Quiziz Pt 2

Ultimate Quiziz Pt 2

9th - 12th Grade

16 Qs

CPA 3NT Paper 1 Quiz 4 (Bukit Panjang High)

CPA 3NT Paper 1 Quiz 4 (Bukit Panjang High)

10th - 12th Grade

20 Qs

Google Classroom

Google Classroom

10th - 12th Grade

15 Qs

Theatre Rigging System Terminology

Theatre Rigging System Terminology

9th - 12th Grade

19 Qs

Gambar Teknik Manufaktur

Gambar Teknik Manufaktur

11th Grade

15 Qs

CPA 4NT Paper 1 Quiz 3 (AMKSS)

CPA 4NT Paper 1 Quiz 3 (AMKSS)

10th - 12th Grade

20 Qs

Notchup Trivia - Logo

Notchup Trivia - Logo

KG - 12th Grade

20 Qs

Quiz #2-Programming

Quiz #2-Programming

11th Grade

20 Qs

ArrayList Practice Questions

ArrayList Practice Questions

Assessment

Quiz

Instructional Technology

11th Grade

Practice Problem

Medium

Created by

Geoff Pritchard

Used 1+ times

FREE Resource

AI

Enhance your content in a minute

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

18 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What method is used to get the number of elements in an ArrayList?

length()

count()

size()

numberOfElements()

2.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which of the following is NOT true about ArrayLists?

They can hold primitive types directly

They are mutable

They are part of the java.util package

They can change size during runtime

3.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Why do ArrayLists use get and set methods instead of the index operator?

Because ArrayLists are not built-in types.

Because ArrayLists are a class with methods.

Because ArrayLists do not support indexing.

Because ArrayLists are immutable.

4.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which statement below is the correct way to retrieve the first element in the nums ArrayList?

nums.get(0)

nums[0]

nums(0)

nums[1]

5.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What is the starting index of an ArrayList?

1

0

-1

10

6.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What happens automatically when primitive types are added to an ArrayList?

They are converted to strings

They are wrapped in objects

They are ignored

They are stored as is

7.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What is the correct way to add an integer to an ArrayList in all Java versions?

list.add(new Integer(5));

list.add(5);

list.add(Integer.valueOf(5));

list.add(5.0);

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?