#154 ArrayLists vs Arrays

#154 ArrayLists vs Arrays

Assessment

Interactive Video

Computers

9th - 12th Grade

Easy

Created by

Myra Deister

Used 4+ times

FREE Resource

7 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the key difference between arrays and ArrayLists when creating them?

ArrayLists require specifying the data type

Arrays require importing a package

ArrayLists don't need to specify the size

Arrays can only hold primitive data types

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which method is used to add elements to an ArrayList?

push()

insert()

append()

add()

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What happens when you try to print an entire array directly?

It prints all elements separated by commas

It print all of the elements within brackets separated by spaces only

It prints gibberish

It throws an error

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a key advantage of ArrayLists over arrays when adding new elements?

ArrayLists are faster

ArrayLists can automatically resize

ArrayLists use less memory

ArrayLists can hold more data types

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which real-world example does the video use to illustrate the usefulness of ArrayLists?

Shopping lists

Phone contacts

YouTube subscriptions

Book collections

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

 Which method is used to remove an element from an ArrayList?

delete()

remove()

erase()

pop()

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What method is used to check if an ArrayList contains a specific element?

has()

includes()

find()

contains()