Which of the following classes provides a resizable array, which can grow as needed?
- Array
- ArrayList
- LinkedList
- Vector
The ArrayList class in Java provides a resizable array that can grow dynamically as elements are added. It is part of the java.util package and is widely used for dynamic collections. LinkedList, while useful for certain scenarios, is not specifically designed as a resizable array like ArrayList. Array represents a fixed-size array, and Vector is similar to ArrayList but is synchronized, making it less efficient in most cases.
Loading...
Related Quiz
- Which of the following stream operations is a terminal operation?
- The method ________ is used to remove all the mappings from a Map.
- Which of the following is true regarding the flow of control in a try-catch-finally statement?
- What is the key difference in approach between the Merge Sort and Quick Sort algorithms?
- Does Java support operator overloading?