AP CS - Chapter 18

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

1/11

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 1:38 AM on 1/29/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

12 Terms

1
New cards

arrays

data structure with a group of elements of the same type with an index; memory to hold the whole array in the same spot is allocated.

2
New cards

1-dimensional array

an array with a single line or column of data

3
New cards

what types of variables are array variables?

reference variables - arrays are objects that need to be initialized to use

4
New cards

how to create a new array?

int an_array = new int[6]; //int = data type of the array; stored with default values

int[ ] myIntArray = {1,324,5,6,67}; //initializer list - specific values

5
New cards

default values

numeric - 0 or 0.0; boolean - false; object reference - null

6
New cards

what value do array indexes start at?

0

7
New cards

how to get or set the element value?

System.out.println(array_name[4])

8
New cards

how to get the length of an array?

array_name.length // cannot be used for a null array

9
New cards

are arrays mutable or immutable?

immutable - elements can’t be added or removed without creating a new array

10
New cards

traversing, iterating, walking through an array

sequentially accessing each array element

11
New cards

last valid index of an array

array length - 1

12
New cards

where is the index variable declared when using a while loop?

outside the loop