AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Csharp array vs arraylist4/7/2024 ![]() ![]() We can create an instance of ArrayList without specifying its size. ![]() It is mandatory to provide the size of an array while initializing it directly or indirectly. It contains popular classes like Vector, HashTable, and HashMap.Īn array is a fixed-length data structure.ĪrrayList is a variable-length data structure. The ArrayList is a class of Java Collections framework. It serves as a container that holds the constant number of values of the same type. ![]() The following table describes the key differences between array and ArrayList: BasisĪn array is a dynamically-created object. They do not preserve the order of elements.Array and ArrayList both can store null values.Array and ArrayList both are used for storing elements.ArrayList arrayObj=new ArrayList()//object of ArrayListĪrrayObj(new Integer(12)) //converts integer primitive to Integer object and added to ArrayList object ![]()
0 Comments
Read More
Leave a Reply. |