What is difference between array and arraylist in java?



What is difference between array and arraylist in java?..

Answer / Pramd Kumar

In Java, Array and ArrayList are two different data structures used for storing collections of elements. An array is a fixed-size collection where elements are stored in contiguous memory locations, whereas ArrayList is a dynamic array that can resize itself as elements are added or removed.nnArrays have a fixed size at the time of declaration and cannot change their size, while ArrayLists can automatically grow or shrink to accommodate new elements.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

What is ascii format?

1 Answers  


Why do we need hashset in java?

1 Answers  


What is Major and importance difference between for and foreach loop ?

1 Answers   Infosys,


What is nan inf?

1 Answers  


What is a thin-client application?

5 Answers   Adobe,


What is supplier in java?

1 Answers  


how to create multithreaded program? : Java thread

1 Answers  


Is string a datatype?

1 Answers  


What are meta-annotations?

1 Answers   Cyient,


What is the memory leak in java?

1 Answers  


What is scanner in java?

1 Answers  


class test { private static void main(String []adsf) { } } explain me that the above code is error or exception

3 Answers  


Categories