Jdk_api Anatomy of the Java.lang pack

Source: Internet
Author: User

Java.lang is the basic package for the Java language, and all of the default packages come in from the import to the class you write. (in alphabetical order)

1, Abstractmethoderror
    • class, error
    • Starting from 1.0 there are
    • Inherit from Incompatibleclasschangeerror
    • This error is thrown when an application attempts to invoke an abstract method. This error is typically caught by the compiler, which can only occur at run time if the definition of a class has made incompatible changes since the last compilation of the current execution method.
    • With message and no parameter constructors
    • There is no custom method
2, Appendable
    • Interface
    • Starting from 1.5 There are
    • No parent interface
    • Appendable is not necessarily secure for multithreaded access. Thread safety is the responsibility of the classes that extend and implement this interface.
    • Provides some append functions, the return value is the Appendable interface
3, ArithmeticException
    • Class, exception
    • Starting from 1.0 there are
    • Inherit from RuntimeException
    • This exception is thrown when an operating condition of an exception occurs. For example, an integer "divided by 0" throws an instance of this class.
    • With message and no parameter constructors
    • No Custom function
4, ArrayIndexOutOfBoundsException
    • Class, exception
    • Starting from 1.0 there are
    • Inherit from Indexoutofboundsexception
    • The exception that is thrown when an array is accessed with an illegal index. If the index is negative or greater than or equal to the array size, the index is an illegal index.
    • With message, index, parameterless constructor
    • No Custom function
5, Arraystoreexception
    • Class, exception
    • Starting from 1.0 there are
    • Inherit from RuntimeException
    • Exception thrown when attempting to store an object of the wrong type to an array of objects
    • With message and no parameter constructors
    • No Custom function
6, Assertionerror
    • class, error
    • Starting from 1.4 There are
    • Inherit from error
    • Throwing the exception indicates that an assertion failed.
    • There are 7 single parameter constructors
    • No Custom function
7, Boolean
    • Final class
    • Starting from 1.0 there are
    • Implement Java.io.serializable,comparable<boolean>
    • The Boolean class boolean wraps the value of the base type in an object. An Boolean object of one type contains only one boolean field of type. In addition, this class boolean String provides many methods for reciprocal conversions and provides boolean some other constants and methods that are useful for processing.

8, Byte
    • Final class
    • Starting from 1.1 There are
    • Inherit from number, implement Comparable<byte>
    • ByteClass wraps the values of the base type byte in an object. An Byte object of one type contains only one byte field of type. In addition, the class byte String provides several methods for reciprocal conversions and provides byte some other constants and methods that are useful for processing.

    • A constant has a byte desirable maximum value, minimum value.
9, Character
    • Final class
    • Starting from 1.0 there are
    • Achieve java.io.Serializable, comparable<character>
    • CharacterClass wraps a value of a base type in an object char . An Character object of type contains char a single field of type. In addition, the class provides several methods to determine the categories of characters (lowercase letters, numbers, and so on), and to convert characters from uppercase to lowercase, and vice versa.

10, Charsequence
    • Interface
    • Starting from 1.4 There are
    • No parent class and interface
    • charsequence is char a readable sequence of values. This interface provides uniform read-only access to many different kinds of char sequences.

    • Provides an abstraction of several common functions of strings
11, Class<t>
    • Final class
    • Starting from 1.0 there are
    • Realized the java.io.Serializable, genericdeclaration,type,annotatedelement
    • ClassInstances of the class represent classes and interfaces in a running Java application. An enumeration is a class, and annotations are an interface. Each array belongs to a class that is mapped to a class object, and all arrays that have the same element type and number of dimensions share the Class object. The basic Java types (,,,,,, boolean byte char short int long float and double ) and keywords void are also represented as Class objects.

    • ClassThere is no public constructor method. Classobjects are constructed automatically by the Java virtual machine and by calling methods in the class loader when the class is loaded defineClass .
    • There are a series of functions that manipulate class.
12, ClassCastException
    • Class, exception
    • Starting from 1.0 there are
    • Inherit from RuntimeException
    • This exception is thrown when an attempt is made to cast an object to a subclass that is not an instance

13, Classcircularityerror
    • class, error
    • Starting from 1.0 there are
    • Inherit from Linkageerror
    • This error is thrown when a class's loop call is detected when initializing classes.

14, Classformaterror
    • class, error
    • Starting from 1.0 there are
    • Inherit from Linkageerror
    • This error is thrown when a Java virtual machine attempts to read a class file and determine that the file is malformed or cannot be interpreted as a class file.

15, ClassLoader
    • Abstract class
    • Starting from 1.0 there are
    • No parent classes and interfaces
    • The class loader is the object that is responsible for loading the class. The ClassLoader class is an abstract class. If a binary name is given to a class, the ClassLoader attempts to find or generate the data that makes up the class definition. The general strategy is to convert the name to a file name and then read the class file for that name from the file system. Each Class object contains a pair of ClassLoader that define it 引用 .

16, ClassNotFoundException
    • Class, exception
    • Starting from 1.0 there are
    • Inherit Reflectiveoperationexception
    • When an application tries to load a class with a string name by using the following method, a method in a class, a method in a class, Class forName ClassLoader findSystemClass ClassLoader a method in a class loadClass , but the definition of a class with the specified name is not found.

17, Cloneable
    • Tag interface
    • Starting from 1.0 there are
    • No parent interface
    • If a class implements an Cloneable interface to indicate that Object.clone() the method can legitimately copy the class instance by field. Cloneableinvoking the Clone method of Object on an instance that does not implement an interface causes an exception to be thrown CloneNotSupportedException

    • No method definition
18, Clonenotsupportedexception
    • Exception class
    • Starting from 1.0 there are
    • Inherit from exception
    • ObjectThis exception is thrown when a method in the calling class clone copies an object, but the object's class does not implement an Cloneable interface. clonean application that overrides the method may also throw this exception, indicating that an object cannot or should not be copied.

19, Comparable<t>
    • Interface
    • Starting from 1.0 there are
    • No parent interface
    • This interface forces the overall ordering of the objects for each class that implements it. This sort is called the natural ordering of the class, and the compareTo method of the class is called its natural comparison method .

    • There is a method int compareTo (T o). Compares the order of this object with the specified object. If the object is less than, equal to, or greater than the specified object, it returns a negative integer, 0, or a positive integer, respectively.
20, Compiler
    • Final class
    • Starting from 1.0 there are
    • No parent classes and interfaces
    • CompilerThe class mainly supports Java-to-native code compilers and related services. By design, Compiler A class doesn't do anything, it acts as a placeholder for a JIT compiler implementation.

    • There are several local methods
21, Double
    • Final class
    • Starting from 1.0 there are
    • Integration from number to implement Comparable<double>
    • DoubleClass wraps a value of a base type in an object double . Each Double type of object contains one double type of field. In addition, the class provides several methods that can be double converted to String , String converted to double , and also provide some other double useful constants and methods for processing.

22, Enum<e extends enum<e>>
    • Abstract class
    • Starting from 1.5 There are
    • implementation of COMPARABLE<E> Serializable
    • This is the public base class for all Java language enumeration types.

    • A separate construction method. The programmer cannot call this constructor method. The construction method is used for code emitted by the compiler that responds to the enumeration type declaration.
23, Enumconstantnotpresentexception
    • Exception class
    • Starting from 1.5 There are
    • Inherit RuntimeException
    • This exception is thrown when an application attempts to access an enumeration constant that does not contain a constant with the specified name, through the name and enumeration type.

24. Error
    • class, error
    • Starting from 1.0 there are
    • Inherit Throwable
    • Erroris a Throwable subclass that is used to indicate a serious problem that a reasonable application should not attempt to capture. Most of these errors are exception conditions. Although the ThreadDeath error is a "normal" condition, it is also a Error subclass, because most applications should not attempt to capture it. During the execution of this method, you do not need to declare in its throws clauses any subclasses that might have been thrown but could not be caught Error , because these errors could be exceptions that would never happen again

25, Exception
    • Class, exception
    • Starting from 1.0 there are
    • Inherit Throwable
    • ExceptionThe class and its subclasses are Throwable a form that identifies the conditions that a reasonable application wants to capture.

26, Exceptionininitializererror
    • class, error
    • Starting from 1.1 There are
    • Inherit Linkageerror
    • 静态初始化程序中发生意外异常的信号。抛出 ExceptionInInitializerError 表明在计算静态初始值或静态变量的初始值期间发生异常。

27, Float
    • Final class
    • Starting from 1.0 there are
    • Inherit number, implement Comparable<float>
    • FloatClass wraps a value of a base type in an object float . An Float object of type contains a float field of type. In addition, this class provides several ways to float convert types and String types to each other, as well as float other constants and methods that are useful when working with types.

28, Illegalaccessexception
    • Exception class
    • Starting from 1.0 there are
    • Inherit exception
    • Illegalaccessexception is thrown when an application attempts to create a reflexive instance (rather than an array), sets or gets a field, or invokes a method, but the currently executing method cannot access the definition of the specified class, field, method, or construction method.

29, IllegalArgumentException
    • Exception class
    • Starting from 1.0 there are
    • Inherit RuntimeException
    • The exception thrown indicates that an invalid or incorrect parameter was passed to the method.

30, Illegalmonitorstateexception
    • Exception class
    • Starting from 1.0 there are
    • Inherit RuntimeException
    • The exception thrown indicates that a thread has tried to wait on the object's monitor, or has attempted to notify other monitors that are waiting on the object and that it does not already have a monitor specified.

31, IllegalStateException
    • Exception class
    • Starting from 1.1 There are
    • Inherit RuntimeException
    • The signal generated when a method is called at an illegal or inappropriate time. In other words, the Java environment or Java application is not in the proper state required by the requested operation.

32, Illegalthreadstateexception
    • Exception class
    • Starting from 1.0 there are
    • Inherit IllegalArgumentException
    • Indicates that the thread did not throw an exception in the appropriate state required by the requested operation. For example, see Thread and methods in a class suspend resume .

33, Incompatibleclasschangeerror
    • class, error
    • Starting from 1.0 there are
    • Inherit Linkageerror
    • This exception is thrown when an incompatible class change occurs in some class definitions. Some of the currently executing methods depend on the class definition that has changed.

34, Indexoutofboundsexception
    • Exception class
    • Starting from 1.0 there are
    • Inherit RuntimeException
    • Indicates that a sorted index (for example, sorting an array, string, or vector) is out of range when thrown. The application can create subclasses for this class to indicate similar exceptions.

35, Inheritablethreadlocal<t>
    • Class
    • Starting from 1.2 There are
    • Inherit threadlocal<t>
    • The class extends the ThreadLocalto provide a value inherited from the parent thread for the child thread: When the child thread is created, the child thread receives the initial value of all inheritable thread local variables to get the value that the parent thread has. Typically, the value of a child thread is consistent with the value of the parent thread, but by overriding the Childvalue method in this class, the child thread's value can be an arbitrary function of the parent thread's value. When the per-thread property (Per-thread-attribute) that is maintained in a variable (such as user ID and transaction ID) must be automatically passed to all child threads created, the inheritable thread local variables should be used as much as possible, rather than normal thread local variables.

36, Instantiationerror
    • class, error
    • Starting from 1.0 there are
    • Inherit RuntimeException
    • newThis exception is thrown when an application attempts to instantiate an abstract class or an interface using the structure of Java. This error is typically caught by the compiler, which can only occur at run time if there are incompatible changes in the class definition.

37, Instantiationerror
    • class, error
    • Starting from 1.0 there are
    • Inherit Incompatibleclasschangeerror
    • newThis exception is thrown when an application attempts to instantiate an abstract class or an interface using the structure of Java. This error is typically caught by the compiler, which can only occur at run time if there are incompatible changes in the class definition.

38, Instantiationexception
    • Class, exception
    • Starting from 1.0 there are
    • Inherit exception
    • This exception is thrown when an application attempts to Class newInstance create an instance of a class using a method in the class, and the specified class object cannot be instantiated. There are many reasons for instantiating failures, including but not limited to the following: class objects represent an abstract class, interface, array class, base type,void,类没有非 null 构造方法

39, Integer
    • Final class
    • Starting from 1.0 there are
    • Inherit number, implement Comparable<integer>
    • IntegerClass wraps a value of a primitive type in an object int . An Integer object of type contains a int field of type. In addition, the class provides several methods that can be int String converted between types and types, as well as int other constants and methods that are useful when handling types.

39, Internalerror
    • class, error
    • Starting from 1.0 there are
    • Inherit Virtualmachineerror
    • This exception indicates some unexpected internal errors in the Java virtual machine.

40, Internalerror
    • class, error
    • Starting from 1.0 there are
    • Inherit Virtualmachineerror
    • This exception indicates some unexpected internal errors in the Java virtual machine.

Jdk_api Anatomy of the Java.lang pack

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.