Contents    Page-10    Prev    Next    Page+10    Index   

Java List Interface

public interface List<AnyType>
    extends Collection<AnyType> {
  int size();
  boolean isEmpty();
  AnyType get( int index );
  AnyType set( int index, AnyType newVal );
  void    add( int index, AnyType x );
  boolean add( AnyType x );    // at end
  void    remove( int index );        }

get and set allow access to elements of the list by position, as in an array; set returns the previous value at that position. add adds a new element to the list after the specified position.