Methods Flashcards

1
Q

compare()

A

compares two arrays

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

copyOf()

A

Creates a copy of an array with a new length

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

deepEquals()

A

Compares two multidimensional arrays to check whether they are deeply equal to each other

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

equals()

A

Checks if two arrays are equal

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

fill()

A

Fills an array with a specified value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

mismatch()

A

Returns the index position of the first mismatch/conflict between two arrays

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

sort()

A

Sorts an array in ascending order

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Array List Methods

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

add()

A

Add an item to the list

boolean|void

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

addAll()

A

Add a collection of items to the list

boolean

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

clear()

A

Remove all items from the list

void

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

clone()

A

Create a copy of the ArrayList

Object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

contains()

A

Checks whether an item exist in the list

boolean

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

ensureCapacity()

A

Increase the capacity of the list to be able to fit a specified number of items

void

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

forEach()

A

Increase the capacity of the list to be able to fit a specified number of items

void

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

forEach()

A

Perform an action on every item in the list

void

18
Q

get()

A

Return the item at a specific position in the list

T

19
Q

indexOf()

A

Return the position of the first occurrence of an item in the list

int

20
Q

isEmpty()

A

Checks whether the list is empty

boolean

21
Q

iterator()

A

Return an Iterator object for the ArrayList

Iterator

22
Q

lastIndexOf()

A

Return the position of the last occurrence of an item in the list

int

23
Q

listIterator()

A

Return a ListIterator object for the ArrayList

ListIterator

24
Q

remove()

A

Remove an item from the list

boolean|T

25
removeAll()
Remove a collection of items from the list | boolean
26
removeIf()
Remove all items from the list which meet a specified condition | boolean
27
replaceAll()
Replace each item in the list with the result of an operation on that item | void
28
retainAll()
Remove all elements from the list which do not belong to a specified collection | boolean
29
set()
Replace an item at a specified position in the list | T
30
size()
Return the number of items in the list | int
31
sort()
Sort the list | void
32
spliterator()
Return a Spliterator object for the ArrayList | Spliterator
33
subList()
Return a sublist which provides access to a range of this list's items | List
34
toArray()
Return an array containing the list's items | Object[]
35
trimToSize()
Reduce the capacity of the list to match the number of items if necessary | Object[]