AbstractList
by , 11-03-2011 at 12:10 PM (628 Views)
AbstractList implements Collection and List interfaces. ArrayList, Vector and AbstractSequentialList extends from AbstractList. Actually AbstractList contains implementation of List interface for random access.
If you want to create a list that should not be modified, then you should extend this class. But then you have to provide implementations for the get(int index) and size() methods.
If you want a list to be modifiable, then you must additionally override set(int index, Object element) method.Java Code:public class MyList extends AbstractList { @Override public Object get(int arg0) { return null; } @Override public int size() { return 0; } }









Email Blog Entry
Size Reduced for Images in PDF &...
05-15-2013, 05:53 PM in Java Software