List Interface in Java


The List interface is an ordered collection that allows duplicate entries, use it for dynamic arrays.

Source Code

List list = new ArrayList();
list.add("Apple");
list.add("Banana");
list.add("Cherry");
System.out.println(list.get(1)); // Access elements by index
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments