Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

java
list

What is a Java list?

Educative Answers Team

In Java, a list interface is an ordered collection of objects in which duplicate values can be stored. Since a List preserves the insertion order, it allows positional access and insertion of elements.

List interface is implemented by the following classes:

Creating list objects

A list is an interface and the instances of a list can be created in the following ways:

  • listType is the class that is implementing the list interface.
  • objType is the data type of the values in the list
  • listName is the name of the list
// Obj is the type of object to be stored in List.
ListType<objType> listName = new ListType<objType> ();   

RELATED TAGS

java
list
Copyright ©2022 Educative, Inc. All rights reserved
RELATED COURSES

View all Courses

Keep Exploring