Java Arrays Test

0.0(0)
studied byStudied by 2 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/12

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

13 Terms

1
New cards

Array

a contiguous chunk of memory to store an ordered list of related data

2
New cards

declare

reserving or requesting memory for the array

3
New cards

populate

to put data into an empty array

4
New cards

traverse

visiting or accessing every element in the array

5
New cards

initializer list

allows an array to be declared and initialized in one statement

6
New cards

how to declare array

datatype [] arrayName = new datatype [#ofElements];

int [] cats = new int [2];

7
New cards

.length

how many elements are in an array

8
New cards

.length - 1

prints the last element of array

9
New cards

Once an array has been instantiated…

the number of elements cannot be changed. 

10
New cards

Array of Objects

collection of object references

11
New cards

When an array of objects is instantiated…

  • it is filled with null. 

  • Each object, like a Coin object, needs to be instantiated. 

  • The references need to be copied into the array. 

12
New cards

Is it possible to have an array of objects where some of the elements are null and some of the elements have references pointing to objects?

YES

13
New cards