Operation and interface on linear list in java

Posted By: Java Examples - 8:32 PM

Share

& Comment

Operations :
  1. isEmpty() - Returns true if the List is empty ,false other wise.
  2. size() - Give the number of element in the list.
  3. get(theIndex) - Give the element with gives index.
  4. indexOf(theElement) - Determines the index of a given element.
  5. remove(theIndex) - Removes element with a given index and returns it.
  6. add(theIndex,theElement) - Add a given element so that new element has a specified index. 


Linear list Interface is given below :

public interface LinearList {
    public boolean isEmpty();
    public int size();
    public Object get(int index);
    public int indexOf(Object elem);
    public Object remove(int index);
    public void add(int index, Object obj);
    public String toString();

}

About Java Examples

I’m passionate about Web Development and Programming and I go to extreme efforts to meet my passion. I’m a believer of learning the fundamentals first. I try to understand everything little bit more than the average.

Copyright © 2016 Java Examples ACHCHUTHAN.ORG. Designed by Templateism .