Java arrays

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

1/20

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.

21 Terms

1
New cards

Array

An elementary data structure that holds elements in a contiguous block of memory.

2
New cards

0-indexed

A method of indexing where the first element of an array is at index 0.

3
New cards

Array Initialization

In Java, creating an array will auto-initialize elements to the zero/null equivalent.

4
New cards

2D Array

An array that contains arrays, often visualized as a table with rows and columns.

5
New cards

Arrays Class

A utility class in Java that provides methods for array manipulation, such as sorting and converting to String.

6
New cards

ArrayList

A resizable array implementation in Java that can hold items and automatically adjust its size.

7
New cards

size() method

Returns the number of elements currently stored in an ArrayList.

8
New cards

add() method

Appends a given value to the end of an ArrayList.

9
New cards

remove() method

Removes the first occurrence of a given value from an ArrayList.

10
New cards

copyOf() method

Creates a new array with a specified length, copying the contents of the original array.

11
New cards

fill() method

Fills an array with a specified value.

12
New cards

Arrays.toString() method

Returns a String representation of the contents of an array.

13
New cards

isEmpty() method

Checks whether an ArrayList has no elements.

14
New cards

indexOf() method

Returns the index of the first occurrence of a specified value in an ArrayList.

15
New cards

clear() method

Removes all elements from an ArrayList, setting its size to 0.

16
New cards

shallow copy

Creating a new reference to an existing array, meaning changes will reflect in both references.

17
New cards

deep copy

Creating a new array that duplicates the contents of an original array.

18
New cards

traversal

The process of accessing each element in an array or collection.

19
New cards

for-each loop

A loop that iterates over the elements of an array without using index variables.

20
New cards

Array access

To retrieve an element from an array using its index.

21
New cards

Random Class

A class in Java used to generate random numbers.