ArrayList implements all List operations using List interface and is also accept null values.The ArrayList is re sizable i.e shrinks and grows automatically and it has a capacity .
The class hierarchy is as follow:
---->Java.Lang.Object
----->Java.Util.AbstactCollection
----->Java.Util.AbstractList
------>Java.Util.ArrayList
The array list contains following methods for implementing different operations
Return type | Method name |
---|---|
void | add (int index, Object o) |
boolean | add (Object o) |
boolean | addAll (Collection c) |
boolean | addAll (int index,Collection c) |
void | clear ( ) |
Object | clone ( ) |
boolean | contains (Object o ) |
Object | get (int index) |
int | indexOf(Object o) |
boolean | isEmpty( ) |
int | lastIndexOf( Object o) |
Object | remove( int index) |
Protected void | removeRange( int fromIndex, int toIndex) |
Object | set (int index, Object o) |
int | size ( ) |
Object [ ] | toArray( ) |
Object [ ] | toArray (Object [ ] a) |
void | trimToSize( ) |