Java 1D ArrayLists Quiz

Java 1D ArrayLists Quiz

12th Grade

15 Qs

quiz-placeholder

Similar activities

PPG 25 Feb 2022

PPG 25 Feb 2022

12th Grade

19 Qs

Microcontroller

Microcontroller

11th Grade - University

10 Qs

Input, output and storage de

Input, output and storage de

8th Grade - Professional Development

14 Qs

IT (data, viruses and more)

IT (data, viruses and more)

8th Grade - Professional Development

20 Qs

ICT WEBINAR QUIZ

ICT WEBINAR QUIZ

KG - Professional Development

20 Qs

Chapter 6 Part 2 - 4

Chapter 6 Part 2 - 4

11th - 12th Grade

11 Qs

Quiz - Quarter 4 (Oracle)

Quiz - Quarter 4 (Oracle)

12th Grade

10 Qs

EMPTECH L4 Q3

EMPTECH L4 Q3

12th Grade

10 Qs

Java 1D ArrayLists Quiz

Java 1D ArrayLists Quiz

Assessment

Quiz

Computers

12th Grade

Practice Problem

Hard

Created by

Tony Banning

Used 2+ times

FREE Resource

AI

Enhance your content in a minute

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

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you declare an ArrayList in Java?

`ArrayList al = new ArrayList();`

`ArrayList[] al = new ArrayList();`

`ArrayList<> al = new ArrayList<>();`

`List al = new ArrayList();`

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the correct way to initialize an ArrayList of Strings?

`ArrayList list = new ArrayList();`

`ArrayList list = new ArrayList();`

`List list = new ArrayList<>();`

All of the above

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you add an element to an ArrayList?

`list.addElement("Hello");`

`list.add("Hello");`

`list.insert("Hello");`

`list.put("Hello");`

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you access the element at index 2 in an ArrayList `list`?

`list[2];`

`list.get(2);`

`list.elementAt(2);`

`list.indexOf(2);`

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which method is used to modify the element at index 3 in an ArrayList `list`?

`list.set(3, "New Element");`

`list.add(3, "New Element");`

`list.replace(3, "New Element");`

`list.update(3, "New Element");`

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you remove the element at index 4 in an ArrayList `list`?

`list.remove(4);`

`list.delete(4);`

`list.erase(4);`

`list.cut(4);`

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is NOT a built-in method of ArrayList?

`clear()`

`length()`

`size()`

`isEmpty()`

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?