How do you increase the capacity of an arraylist?



How do you increase the capacity of an arraylist?..

Answer / Ravi Kumar Arya

When the number of elements in an ArrayList exceeds its current capacity, it automatically doubles its size by creating a new array and copying all the old elements to the new one.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Data Structures Interview Questions

What is hashing in cyber security?

1 Answers  


What is bubble sort in data structure?

1 Answers  


Explain the Complete structure of hashmap along with the basic coding of the hashmap internal implementation.

1 Answers   Expedia,


How to check array contains value or not?

1 Answers  


Are linked lists useful?

1 Answers  


Define threaded binary tree. Explain its common uses

1 Answers  


How do you use merge sort?

1 Answers  


What is inserting in data structure?

1 Answers  


What are some of the best practices relating to the java collection framework?

1 Answers  


Are linked lists considered linear or non-linear data structure?

1 Answers  


What is inplace sorting?

1 Answers  


Does mentioning the array name gives the base address in all the contexts?

1 Answers  


Categories