1/35
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
ArrayList
A resizable array implementation in Java that allows dynamic addition and removal of elements.
Dynamic Array
An array that can change in size during the execution of a program.
O(1) time complexity
Constant time operation, meaning the execution time does not change based on the size of the input.
O(n) time complexity
Linear time operation, meaning the execution time increases linearly with the size of the input.
add() method
A method used to add an element to the end of an ArrayList.
get() method
A method that retrieves an element from the ArrayList at a specified index.
clear() method
A method that removes all elements from the ArrayList.
isEmpty() method
A method that checks if the ArrayList has no elements.
contains() method
A method that checks if a specified element exists in the ArrayList.
indexOf() method
A method that returns the index of the first occurrence of the specified element, or -1 if not found.
remove(index) method
A method that removes the element at the specified index and shifts subsequent elements to the left.
remove(element) method
A method that removes the first occurrence of the specified element from the ArrayList.
toString() method
A method that returns a string representation of the ArrayList.
Initial capacity of ArrayList
The default number of positions allocated for an ArrayList when it is created.
IndexOutOfBoundsException
An exception indicating an attempt to access an invalid index in the ArrayList.
Iterator
An object that enables traversing through elements in a collection, such as ArrayList, in a sequential manner.
forEach() method
A method that performs an action for each element in the ArrayList.
List Interface
An interface in Java that defines a contract for ordered collections and provides methods for manipulating them.
Capacity
The amount of space allocated for an ArrayList. Can grow as needed.
Synchronization
The process of controlling access to a shared resource in concurrent programming.
Clone() method
A method that creates a copy of the ArrayList.
SubList() method
A method that returns a view of a portion of the ArrayList between specified indices.
ListIterator
An iterator that allows traversing a list in both directions and modifying the list during iteration.
Sorting
The process of arranging the elements of an ArrayList in a specified order, typically ascending or descending.
Shallow Copy
A copy of an ArrayList where the elements are referenced, not duplicated.
Abstract Class
A class that cannot be instantiated on its own and is designed to be subclassed.
Encapsulation
The bundling of the data (attributes) and methods (functions) that operate on that data into a single unit or class.
Constructor
A special method invoked at the time of object creation, used to initialize the object.
Access Modifiers
Keywords that set the visibility of classes, methods, and other members; include public, private, protected, and default.
What is an Object?
An object is an instance of a class that contains data and behavior defined by the class.
What does JVM stand for?
Java Virtual Machine, which provides a runtime environment to execute Java bytecode.
What is Exception Handling?
A mechanism in Java to handle runtime errors, allowing the program to continue execution or fix the issue gracefully.
What is an Array?
A collection of variables of the same type, accessed using an index.
What is Method Overloading?
A feature that allows multiple methods in the same class with the same name but different parameters.
What is Method Override?
The ability of a subclass to provide a specific implementation of a method already defined in its superclass.
What is a String in Java?
A sequence of characters represented as an object in Java, immutable after creation.