#084 ArrayLists

#084 ArrayLists

Assessment

Interactive Video

Computers

9th Grade

Easy

Created by

Myra Deister

Used 6+ times

FREE Resource

9 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the first difference that is expressed in the video between an Array and an ArrayList?

ArrayLists require importing a specific class before use

Regular arrays don't need to specify a data type

ArrayLists must have a fixed size when created

Regular arrays can only hold primitive data types

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

When creating a new ArrayList, what is true about its initial size?

It starts with size 10 by default

It starts with size 0 and grows as needed

You must specify the initial size

It has the same size as the last ArrayList created

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

 What happens to existing elements when you use add(1, "tuna") on an ArrayList?

The existing element at index 1 is replaced

All existing elements are deleted

Elements from index 1 onward shift right by one position

The new element is added only if index 1 is empty

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do the two versions of the add() method differ in functionality?

One adds integers, the other adds strings

One adds single elements, the other adds multiple elements

One returns true, the other returns false

One adds at the end, the other adds at a specified index

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the key difference between set() and add() methods?

set() can only modify existing indexes while add() can expand the list

set() works with strings only

add() can only append to the end

There is no difference

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What happens when you remove() an element from an ArrayList?

The space is left empty

A null value replaces the removed element

Subsequent elements shift left to fill the gap

The ArrayList size stays the same

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which statement about ArrayList limitations is correct?

ArrayLists can hold both primitive and object types directly

ArrayLists can only hold primitive types

ArrayLists can only hold object types

ArrayLists can only hold strings

8.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How does modern Java handle primitive-to-wrapper conversion?

It must always be done manually

It uses autoboxing to handle conversion automatically

It's not possible to convert primitives

It requires external libraries

9.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you access the number of elements in an ArrayList versus an array?

Both use .length()

ArrayList uses .size() and array uses .length

Both use .size()

ArrayList uses .length and array uses .size()