Java 1D ArrayLists Quiz

Java 1D ArrayLists Quiz

12th Grade

15 Qs

quiz-placeholder

Similar activities

Threats to Data

Threats to Data

9th - 12th Grade

11 Qs

1.1.1 The structure and function of the processor

1.1.1 The structure and function of the processor

11th Grade - University

15 Qs

PUNCTUATION SPACING RULES

PUNCTUATION SPACING RULES

9th - 12th Grade

10 Qs

Basics of spreadsheet

Basics of spreadsheet

12th Grade

15 Qs

Microsoft Office Advandces 2016

Microsoft Office Advandces 2016

9th Grade - Professional Development

20 Qs

Arduino Loop

Arduino Loop

2nd Grade - University

20 Qs

Python List

Python List

4th Grade - University

15 Qs

QUIZ BAB 4: SISTEM OPERASI

QUIZ BAB 4: SISTEM OPERASI

8th Grade - University

20 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()`

Create a free account and access millions of resources

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?