CollectionYesJavaThe interface under. util, which is the parent interface of various collection structures.
CollectionsYesJavaClass under. util, which contains various static methods related to set operations.
CollectionThe Root Interface in the hierarchy.CollectionRepresents a group of objects, also known
CollectionOfElement. Some
CollectionRepeated elements are allowed, while others are not. Some
CollectionIs ordered, while others are disordered. JDK does not provide anyDirectImplementation: it provides more specific sub-interfaces (such as set and list) implementation. This interface is usually used to pass
CollectionAnd operate on these
Collection.
Collection
Shortlist
│ Invalid parameter list
│ ├ Arraylist
│ Vector
│ Elastic Stack
Sorted set
CollectionsThis class is entirely caused
CollectionOr return
CollectionStatic method. It is included in
CollectionThe multi-state algorithm operated on, that is, the package.
CollectionSupported new
CollectionAnd a few others. If
CollectionOr if the class object is null, these methods will throw nullpointerexception.
JavaCode
- Import Java. Util. arraylist;
- Import Java. Util.Collections;
- Import Java. Util. List;
- Public ClassTestcollections {
- Public Static VoidMain (string ARGs []) {
- // Note that list is an implementationCollectionInterface
- List list =NewArraylist ();
- DoubleArray [] = {112,111, 23,456,231 };
- For(IntI = 0; I <array. length; I ++ ){
- List. Add (NewDouble (array [I]);
- }
- Collections. Sort (list );
- For(IntI = 0; I <array. length; I ++ ){
- System. Out. println (list. Get (I ));
- }
- // Result: 23.0 111.0 112.0 231.0 456.0
- }
- }
Collection: The upper-level interface of the Collection class. The interfaces inherited from it mainly include set and list.
Collections: PairCollectionThe Collection class of some static methods of object operations, such as sorting, thread synchronization, and search, is actually a helper class. The return type of these methods is basicallyCollectionAnd a few others.