java.util.List

List is an interface, the most widely used data structure in java, implements the Collections interface.

List stores a list of objects, in an inserted order, stores duplicate values.

There are different data structure implementations of List interface, like ArrayList class, LinkedList class, Vector class etc.,

1. Insert/Delete a Object in a List

Methods : add(), remove() etc.,

Result:

2. Search/Retrieve an Object from a List

Methods : contains(), indexOf() etc.,

Result:

Leave a Reply

Your email address will not be published. Required fields are marked *