AP CSA Unit 4 ArrayLists: Dynamic Lists, Traversal, and List-Based Algorithms

0.0(0)
Studied by 0 people
0%Unit 4 Mastery
0%Exam Mastery
Build your Mastery score
multiple choiceMultiple Choice
call kaiCall Kai
Supplemental Materials
Card Sorting

1/24

Last updated 3:08 PM on 3/12/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

25 Terms

1
New cards

Primitive type

A basic Java type (e.g., int, double) that stores a raw value directly and is not an object.

2
New cards

Reference type

A Java type that refers to an object (a class type), can be used with generics, and can be null.

3
New cards

Wrapper class

A class that represents a primitive value as an object so it can be used where objects are required (e.g., in generics/ArrayLists).

4
New cards

Integer (wrapper)

The wrapper class that stores an int value as an object.

5
New cards

Double (wrapper)

The wrapper class that stores a double value as an object.

6
New cards

Generics

Java feature using type parameters like ArrayList to enforce what element types a collection can hold; generic types must be reference types.

7
New cards

ArrayList

A resizable, indexed list from java.util that stores objects and can grow/shrink during execution.

8
New cards

Type parameter (e.g., E in ArrayList)

The specified element type for a generic class (e.g., String in ArrayList) that provides type safety.

9
New cards

Autoboxing

Automatic conversion of a primitive to its wrapper object (e.g., int to Integer) when needed.

10
New cards

Unboxing

Automatic conversion of a wrapper object to its primitive value (e.g., Integer to int) when needed.

11
New cards

NullPointerException (unboxing null)

Error that can occur if a null wrapper reference (e.g., Integer) is automatically unboxed to a primitive.

12
New cards

== vs .equals(…) (objects)

== compares object references (identity), while .equals(…) compares values/content (when implemented appropriately).

13
New cards

Floating-point precision (Double)

Limitation of double/Double where rounding can make values that “should” match fail exact equality comparisons.

14
New cards

Zero-indexed

Indexing rule where the first element is at index 0 and the last is at index size() - 1.

15
New cards

IndexOutOfBoundsException

Exception thrown when accessing or modifying an ArrayList with an invalid index (e.g., index < 0 or index >= size()).

16
New cards

size()

ArrayList method that returns the number of elements in the list; last valid index is size() - 1.

17
New cards

add(E obj)

ArrayList method that appends an element to the end of the list and increases size by 1.

18
New cards

add(int index, E obj)

ArrayList method that inserts an element at a given index and shifts existing elements at/after that index to the right.

19
New cards

get(int index)

ArrayList method that returns the element at the given index without changing the list.

20
New cards

set(int index, E obj)

ArrayList method that replaces the element at index, returns the old value, and keeps the same list size.

21
New cards

remove(int index)

ArrayList method that removes and returns the element at index and shifts later elements left.

22
New cards

remove overload gotcha (ArrayList)

With ArrayList, remove(2) removes index 2 (not the value 2); to remove a value, use remove(Integer.valueOf(2)).

23
New cards

Enhanced for loop (for-each)

Traversal that visits each element for reading (e.g., for (String s : words)); generally not used for structural add/remove.

24
New cards

Backward traversal for removals

Safe pattern for removing elements: loop from size() - 1 down to 0 so shifting doesn’t skip unvisited elements.

25
New cards

Integer division vs casting to double

If both operands are int, division truncates; cast (e.g., (double) sum / size()) to compute a decimal average.

Explore top notes

note
Invisible Man Chapter 1
Updated 1173d ago
0.0(0)
note
Media & Information Literacy
Updated 322d ago
0.0(0)
note
Invisible Man Chapter 7
Updated 1173d ago
0.0(0)
note
Unit 3 : Macromolecules
Updated 313d ago
0.0(0)
note
International Cooperation
Updated 1195d ago
0.0(0)
note
Biochimie
Updated 746d ago
0.0(0)
note
Invisible Man Chapter 1
Updated 1173d ago
0.0(0)
note
Media & Information Literacy
Updated 322d ago
0.0(0)
note
Invisible Man Chapter 7
Updated 1173d ago
0.0(0)
note
Unit 3 : Macromolecules
Updated 313d ago
0.0(0)
note
International Cooperation
Updated 1195d ago
0.0(0)
note
Biochimie
Updated 746d ago
0.0(0)

Explore top flashcards

flashcards
S.S. Unit 3 - Study Guide
57
Updated 126d ago
0.0(0)
flashcards
Chapter 27
120
Updated 705d ago
0.0(0)
flashcards
Lit Words: 2 The Boogaloo
24
Updated 496d ago
0.0(0)
flashcards
Lab Practical 3
75
Updated 755d ago
0.0(0)
flashcards
Polyatomic Ions
21
Updated 768d ago
0.0(0)
flashcards
Latin Week 5
26
Updated 920d ago
0.0(0)
flashcards
Connect 4, Unit 3
52
Updated 1011d ago
0.0(0)
flashcards
S.S. Unit 3 - Study Guide
57
Updated 126d ago
0.0(0)
flashcards
Chapter 27
120
Updated 705d ago
0.0(0)
flashcards
Lit Words: 2 The Boogaloo
24
Updated 496d ago
0.0(0)
flashcards
Lab Practical 3
75
Updated 755d ago
0.0(0)
flashcards
Polyatomic Ions
21
Updated 768d ago
0.0(0)
flashcards
Latin Week 5
26
Updated 920d ago
0.0(0)
flashcards
Connect 4, Unit 3
52
Updated 1011d ago
0.0(0)