Java. Lang is a basic class for programming using the Java programming language.

Source: Internet
Author: User

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());

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.