What is list in java collections?

devquora
devquora

Posted On: Feb 22, 2018

 

A list is one of the interfaces in the Java collection framework. It stores an ordered collection of data and objects. Duplicate values can also be stored in the list interface. The insertion and removal of elements in the list are based on the index.

The list interface has various default methods for manipulating data in it. Some of the important methods used in the list are added, addAll, clear, get, isEmpty, etc.

// Example of list declaration
public interface List extends Collection

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    Collections in Java Interview Questions

    What is Collection in Java?

    A Collection in Java is a group of objects that are represented as a single unit. The group of objects is stored as a single unit where you can manipulate the objects. You can do various operations o...

    Collections in Java Interview Questions

    What is garbage collection in Java?

    The Garbage Collection in Java is a memory management process. In C/C++, the programmer is responsible for clearing the unused memory used by the objects. But in Java, the programmer need not take car...

    Collections in Java Interview Questions

    What is collection framework in java?

    The collection framework in Java is used to store data and process it efficiently. It is nothing but a collection of interfaces and classes. The collection interface is subdivided into the list, set...