It is also a base of ListIterator classes using which we can iterate the List in forward and backward directions. It implements ArrayList, LinkedList, Stack, and Vector classes. The List interface takes place in java.util package. It provides an index-based method to perform the insert, delete, search, update operations on the objects. We can store the duplicate values and null elements using List. The List is a child interface of the Collection framework that allows us to maintain the ordered collection of the objects. The List is an interface, and ArrayList is a class. In this section, we will differentiate two elements of the Collection framework, which is List and ArrayList. The interfaces contain Set, List, Queue, Deque, and classes contain ArrayList, Vector, LinkedList, HashSet, TreeSet, LinkedHashSet, and PriorityQueue. Java Collection framework provides several interfaces and classes. We can easily perform many operations such as searching, sorting, insertion, deletion, and manipulation on a group of objects using the collection framework. It allows us to store and manipulate the group of objects as a single unit. The collection means a single unit of objects. The Java Collection provides an architecture to deal with the group of objects. Next → ← prev Difference between List and ArrayList
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |