MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

DATA STRUCTURES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
This data structure extends an array’s functionality.
A
ArrayList
B
Queues
C
Stacks
D
List
Explanation: 

Detailed explanation-1: -The ArrayList class extends AbstractList and implements the List interface. ArrayList supports dynamic arrays that can grow as needed.

Detailed explanation-2: -The backing data structure of ArrayList is an array of Object class. When creating an ArrayList you can provide initial capacity then the array is declared with the given capacity. The default capacity value is 10.

Detailed explanation-3: -ArrayList in Java is used to store dynamically sized collection of elements. Contrary to Arrays that are fixed in size, an ArrayList grows its size automatically when new elements are added to it. ArrayList is part of Java’s collection framework and implements Java’s List interface.

Detailed explanation-4: -An ArrayList class is a resizable array, which is present in the java. util package. While built-in arrays have a fixed size, ArrayLists can change their size dynamically. Elements can be added and removed from an ArrayList whenever there is a need, helping the user with memory management.

There is 1 question to complete.