Javase
- Collection and the difference between collections.
// Collection the previous interface of the inheriting class, List, Set, inherits from it,
Collections is a helper class for collection classes that provides a tool method for collection operations.
Collection is a collection interface. It provides a common interface method for basic manipulation of collection objects. the collection interface has many specific implementations in the Java class Library. The meaning of the collection interface is to provide a maximum unified operation for a variety of specific collections.
Collections is a wrapper class. It contains a variety of static polymorphic methods related to set operations. This class cannot be instantiated, just like a tool class that serves the Java collection framework
2. whether an interface can inherit an interface ? whether an abstract class can be implemented (implements) Interface ? whether an abstract class can inherit entity classes (concrete Class)?
An interface can inherit an interface, an abstract class can implement an interface, and an abstract class can inherit an entity class
Abstract class is an entity class that can inherit, but only if the entity class must have a definite constructor , actually from Object is an entity class .
3 . int and the Integer What's the difference?
an Int is a basic data type that defines constants. the Integer is related to boxing.
Integer is the wrapper class for int, and int is the basic data type;
Integer variables must be instantiated before they can be used; int variables are not required;
An integer is actually a reference to the object, which points to the integer object of this new, and int is a direct store of the data value;
The default value of Integer is 0 for the default value of Null;int.
4. Does the List, Set, and Map inherit from the Collection interface ?
List,set Yes, map is not
Map does not inherit the collection interface , andmap provides a key-to-value mapping. A map cannot contain the same key, and each key can only map one value
List features : elements are placed in order, elements can be duplicated
Map features : element key value to store, no in order
Set features : elements are not placed in order, elements are not repeatable
Several problems of Java EE