Java Arrays and ArrayLists

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

1/11

flashcard set

Earn XP

Description and Tags

Flashcards for Java Arrays and ArrayLists

Last updated 11:27 PM on 5/9/25
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

12 Terms

1
New cards

Array

A data structure in Java that can hold a fixed number of elements of the same type.

2
New cards

ArrayList

A dynamic list in Java that allows adding and removing elements, providing flexibility in size.

3
New cards

Static (Array)

Arrays are static, meaning their length cannot be changed once created.

4
New cards

Dynamic (ArrayList)

ArrayLists are dynamic, meaning they can grow or shrink to accommodate more or fewer elements.

5
New cards

Generics

ArrayList support Generics, hence they provide compile time type-safety.

6
New cards

Primitives and Objects (Array)

Arrays can hold both primitive types (int, char) and objects (String, Integer).

7
New cards

Objects (ArrayList)

ArrayLists can only hold object elements; they cannot store primitive types directly.

8
New cards

Memory Usage (Array vs. ArrayList)

Arrays typically take less memory than ArrayLists for storing the same number of elements.

9
New cards

Element Removal

ArrayList allows you to remove element, but array doesn't provide such methods.

10
New cards

Multi-dimensionality

Arrays can be multi-dimensional, while ArrayLists are always one-dimensional.

11
New cards

Length vs Size

Array length attribute is capacity, whereas ArrayList size() method returns the number of elements.

12
New cards