Slide07_ArrayLists

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

1/35

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.

36 Terms

1
New cards

ArrayList

A resizable array implementation in Java that allows dynamic addition and removal of elements.

2
New cards

Dynamic Array

An array that can change in size during the execution of a program.

3
New cards

O(1) time complexity

Constant time operation, meaning the execution time does not change based on the size of the input.

4
New cards

O(n) time complexity

Linear time operation, meaning the execution time increases linearly with the size of the input.

5
New cards

add() method

A method used to add an element to the end of an ArrayList.

6
New cards

get() method

A method that retrieves an element from the ArrayList at a specified index.

7
New cards

clear() method

A method that removes all elements from the ArrayList.

8
New cards

isEmpty() method

A method that checks if the ArrayList has no elements.

9
New cards

contains() method

A method that checks if a specified element exists in the ArrayList.

10
New cards

indexOf() method

A method that returns the index of the first occurrence of the specified element, or -1 if not found.

11
New cards

remove(index) method

A method that removes the element at the specified index and shifts subsequent elements to the left.

12
New cards

remove(element) method

A method that removes the first occurrence of the specified element from the ArrayList.

13
New cards

toString() method

A method that returns a string representation of the ArrayList.

14
New cards

Initial capacity of ArrayList

The default number of positions allocated for an ArrayList when it is created.

15
New cards

IndexOutOfBoundsException

An exception indicating an attempt to access an invalid index in the ArrayList.

16
New cards

Iterator

An object that enables traversing through elements in a collection, such as ArrayList, in a sequential manner.

17
New cards

forEach() method

A method that performs an action for each element in the ArrayList.

18
New cards

List Interface

An interface in Java that defines a contract for ordered collections and provides methods for manipulating them.

19
New cards

Capacity

The amount of space allocated for an ArrayList. Can grow as needed.

20
New cards

Synchronization

The process of controlling access to a shared resource in concurrent programming.

21
New cards

Clone() method

A method that creates a copy of the ArrayList.

22
New cards

SubList() method

A method that returns a view of a portion of the ArrayList between specified indices.

23
New cards

ListIterator

An iterator that allows traversing a list in both directions and modifying the list during iteration.

24
New cards

Sorting

The process of arranging the elements of an ArrayList in a specified order, typically ascending or descending.

25
New cards

Shallow Copy

A copy of an ArrayList where the elements are referenced, not duplicated.

26
New cards

Abstract Class

A class that cannot be instantiated on its own and is designed to be subclassed.

27
New cards

Encapsulation

The bundling of the data (attributes) and methods (functions) that operate on that data into a single unit or class.

28
New cards

Constructor

A special method invoked at the time of object creation, used to initialize the object.

29
New cards

Access Modifiers

Keywords that set the visibility of classes, methods, and other members; include public, private, protected, and default.

30
New cards

What is an Object?

An object is an instance of a class that contains data and behavior defined by the class.

31
New cards

What does JVM stand for?

Java Virtual Machine, which provides a runtime environment to execute Java bytecode.

32
New cards

What is Exception Handling?

A mechanism in Java to handle runtime errors, allowing the program to continue execution or fix the issue gracefully.

33
New cards

What is an Array?

A collection of variables of the same type, accessed using an index.

34
New cards

What is Method Overloading?

A feature that allows multiple methods in the same class with the same name but different parameters.

35
New cards

What is Method Override?

The ability of a subclass to provide a specific implementation of a method already defined in its superclass.

36
New cards

What is a String in Java?

A sequence of characters represented as an object in Java, immutable after creation.