Description of the software package java. LANG: provides basic classes for Program Design Using Java programming language. The most important class isObject(It is the root of the class hierarchy) andClass(Its instance indicates the class in the running application ).
It is usually necessary to regard the value of the basic type as an object. Package TypeBoolean,Character,Integer,Long,FloatAndDoubleIs used for this purpose. For exampleDoubleA type object contains a field of the double type. This indicates that if a value is referenced, the value can be stored in the variable of the reference type. These classes also provide a large number of methods for converting the base value and support some standard methods, such as equals and hashcode.VoidA class is a non-instantiated class that maintains a pair that represents the basic type voidClassObject reference.
ClassMathProvides common mathematical functions, such as sine, cosine, and square root. SimilarlyStringAndStringBufferProvides common string operations.
ClassClassLoader,Process,Runtime,SecurityManagerAndSystemProvides "system operations" such as dynamic loading of management classes, external process creation, host environment query (such as time), and security policy implementation ".
ClassThrowableContains objects that may be thrown by the throw Statement (§ 14. 16 ).ThrowableSubclasses of indicate errors and exceptions.
Read the specific meanings of the class! The following is a description of the javaapi documentation:
ClassAn instance of the class indicates the classes and interfaces in the running Java application. Enumeration is a type, and annotation is an interface. Each array is a class mapped to a Class Object. All arrays with the same element type and dimension shareClassObject. Basic Java type (boolean,byte,char,short,int,long,floatAnddouble) And keywordsvoidAlsoClassObject.
ClassThere is no public constructor.ClassObjects are loaded by the Java Virtual Machine and by calling the class loader.defineClassMethod automatically constructed.
The following example usesClassObject To display the Class Name of the object:
void printClassName(Object obj) { System.out.println("The class of " + obj + " is " + obj.getClass().getName()); }
You can also use a class literal (JLS section 15.8.2) to obtainClassObject. For example:
System.out.println("The name of class Foo is: "+Foo.class.getName());