Posts

Showing posts with the label List interface in java with example

List interface in java with examples

Read this article to know what is List interface and what are the List implemented classes in java with example programs.  List interface  represents a group of elements arranged like an array in java. List will grow dynamically when the elements are stored into it. List will allow duplicate elements to store into it. List interface implemented classes are,   ArrayList<E> Vector< E > LinkedList< E >           < E > represents the genetic type of storing element into List. List interface methods: The below are the list of methods which are available in List Interface. These methods are also available in subclasses of the List interface.   void add( int position, element obj): Adds the second argument into the List at the index specified by the first argument.   void add(element obj): This method appends the specified element to the end of the ArrayList. If the element is added successfully then the preceding meth