Skip to main content
Properties ArrayList (Class) and when ArrayList can be used .
ArrayList
1. ArrayList is growable Array.
2. ArrayList insertion order is preserved
3. In ArrayList duplicates values are allowed
4. In ArrayList null insertion is possible.
5. In ArrayList we can insert Heterogeneous objects
6. During creation of object in ArrayList it has default capacity 10.
ArrayList obj=new ArrayList(); when ArrayList reaches default capacity it will increment based on this formula
new size=(current size*3/2)+1;
7. ArrayList implements Serializable,Clonable and RandomAccess interface.
ArrayList is best when accessing the elements frequently because ArrayList implements RandomAccess Interface. Because of RandomAccess we can access any elements at a same speed .
Comments
Post a Comment