Array vs ArrayList Comparison

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/18

flashcard set

Earn XP

Description and Tags

These flashcards cover key concepts related to Arrays and ArrayLists, including methods, properties, and comparisons, to assist in understanding their use and differences.

Last updated 1:57 PM on 2/27/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

19 Terms

1
New cards

What method is used to add an element to a specific index in a list?

list.add(index, element);

2
New cards

What symbols are used in an ArrayList?

<> (angle brackets)
3
New cards

What types of data can be used in an Array?

Primitive data types (int, double, etc.) and Objects (including String)

4
New cards

What types of data can be used in an ArrayList?

Objects ONLY (Wrapper classes like Integer, Double, Character)

5
New cards

What method can be used to get the length of an ArrayList?

.size();

6
New cards

What property can be used to get the length of an Array?

.length

7
New cards

Which method is used to convert an Array to a String representation?

Arrays.toString(arrayName);

8
New cards

Which method is used to convert an ArrayList to a String representation?

.toString();

9
New cards

True or False: An Array can only be a fixed size.

True

10
New cards

True or False: An ArrayList can only be a fixed size.

False

11
New cards

True or False: An Array uses the wrapper class.

False

12
New cards

What collection is used when you need a fixed size, high performance data structure, especially for primitives?

Array

13
New cards

What collection is used when working with objects that need flexibility and dynamic resizing?

ArrayList

14
New cards

What is the term for looping through lists of data and performing an action with each item?

Traversing

15
New cards

Which loop is used to directly loop through each item in a list?

For Each Loop

16
New cards

What is NOT a drawback of a For Each loop?

Can’t loop through each item in a list of items.

17
New cards

Provide an example of a For Each loop.

for(int num : nums){ System.out.println("Number: " + num); }

18
New cards

What is the correct way to use the .remove() method?

schoolSupplies.remove(pencil);

19
New cards

What error will occur with the line 'schoolSubjects.add('Science');'?

Single quotes represent char, not String.

Explore top notes

Explore top flashcards

flashcards
BIS Final Acronyms
40
Updated 836d ago
0.0(0)
flashcards
Filmgeschiedenis 2 (2022-2023)
134
Updated 1014d ago
0.0(0)
flashcards
Tema 2B: ¿Quién Soy Yo?
65
Updated 68d ago
0.0(0)
flashcards
civil war
25
Updated 1223d ago
0.0(0)
flashcards
Elbow and Forearm
54
Updated 734d ago
0.0(0)
flashcards
BIS Final Acronyms
40
Updated 836d ago
0.0(0)
flashcards
Filmgeschiedenis 2 (2022-2023)
134
Updated 1014d ago
0.0(0)
flashcards
Tema 2B: ¿Quién Soy Yo?
65
Updated 68d ago
0.0(0)
flashcards
civil war
25
Updated 1223d ago
0.0(0)
flashcards
Elbow and Forearm
54
Updated 734d ago
0.0(0)