Java record-42-Java Collection
Collections are most frequently used in Java Collection Development. arrays are the basis of collections. Java provides a collection framework for collections and related classes and interfaces in the java. util package. A large number of collections can be used in programming to improve program performance. Interfaces in a collection framework: a framework is a collection of class libraries. A collection framework is a unified architecture that represents operable sets, including interfaces and classes that implement the set. Public interface Collection <E> extends Iterable <E> root interface in the Collection hierarchy. Collection represents a group of objects, also known as collection elements. Some collections allow repeated elements, while others do not. Some collections are ordered, while others are disordered. JDK does not provide any direct implementation of this interface: it provides more specific sub-interfaces (such as Set and List. This interface is usually used to pass collections and operate these collections where the maximum universality is required. Public interface List <E> extends Collection <E> An ordered collection (also called a sequence ). Users of this interface can precisely control the insert position of each element in the list. You can access the element based on the integer index (position in the list) of the element and search for the element in the list. Public interface Set <E> extends Collection <E> a collection that does not contain duplicate elements. More specifically, set does not contain e1 and e2 elements that meet e1.equals (e2), and contains at most one null element. As its name implies, this interface imitates the set abstraction in mathematics. Public interface Map <K, V> maps the key to the value object. A ing cannot contain duplicate keys. Each key can only be mapped to one value at most. The Map interface provides three collection views, allowing you to view the content of a ing in the form of a key set, value set, or key-value ing link set. The ing order is defined as the order in which the iterator returns its elements in the ing collection view. Some ing implementations can clearly ensure their order, such as the TreeMap class. Other ing implementations do not guarantee the order, such as the HashMap class.
Next article: http://www.bkjia.com/kf/201510/447444.html