Generated by
JDiff

java.lang Documentation Differences

This file contains all the changes in documentation in the package java.lang as colored differences. Deletions are shown like this, and additions are shown like this.
If no deletions or additions are shown in an entry, the HTML tags will be what has changed. The new HTML tags are shown in the differences. If no documentation existed, and then some was added in a later version, this change is noted in the appropriate class pages of differences, but the change is not shown on this page. Only changes in existing text are shown here. Similarly, documentation which was inherited from another class or interface is not shown here.
Note that an HTML error in the new documentation may cause the display of other documentation changes to be presented incorrectly. For instance, failure to close a <code> tag will cause all subsequent paragraphs to be displayed differently.

Class AbstractMethodError

Thrown when an application tries to call an abstract method. Normally this error is caught by the compiler; this error can only occur at run time if the definition of some class has incompatibly changed since the currently executing method was last compiled. @author unascribed @version 1.13 0915 02/2102/9800 @since JDK1.0

Class ArithmeticException

Thrown when an exceptional arithmetic condition has occurred. For example an integer "divide by zero" throws an instance of this class. @author unascribed @version 1.17 0919 02/2102/9800 @since JDK1.0

Class ArrayIndexOutOfBoundsException

Thrown to indicate that an array has been accessed with an illegal index. The index is either negative or greater than or equal to the size of the array. @author unascribed @version 1.16 0918 02/2102/9800 @since JDK1.0

Class ArrayStoreException

Thrown to indicate that an attempt has been made to store the wrong type of object into an array of objects. For example the following code generates an ArrayStoreException:

 Object x[] = new String[3]; x[0] = new Integer(0); 
@author unascribed @version 1.6 098 02/2102/9800 @since JDK1.0

Class Boolean

The Boolean class wraps a value of the primitive type boolean in an object. An object of type Boolean contains a single field whose type is boolean.

In addition this class provides many methods for converting a boolean to a String and a String to a boolean as well as other constants and methods useful when dealing with a boolean. @author Arthur van Hoff @version 1.29 0738 02/2302/9800 @since JDK1.0

Class Boolean, boolean getBoolean(String)

Returns true if and only if the system property named by the argument exists and is equal to the string "true". (Beginning with version 1.0.2 of the JavaTM platform the test of this string is case insensitive.) A system property is accessible through getProperty a method defined by the System class.

If there is no property with the specified name or if the specified name is empty or null then false is returned. @param name the system property name. @return the boolean value of the system property. @see java.lang.System#getProperty(java.lang.String) @see java.lang.System#getProperty(java.lang.String java.lang.String)

Class Boolean, Boolean valueOf(String)

Returns thea Boolean with booleana value represented by the specified String. A newThe Boolean object is constructed. This Booleanreturned represents the value true if the string argument is not null and is equal ignoring case to the string "true".

Example: Boolean.valueOf("True") returns true.
Example: Boolean.valueOf("yes") returns false. @param s a string. @return the Boolean value represented by the string.


Class Byte

The Byte class is the standard wrapper for byte values. @author Nakul Saraiya @version 1.13 0920 02/2102/9800 @see java.lang.Number @since JDK1.1
Class Byte, int compareTo(Byte)

Compares two Bytes numerically. @param anotherByte the Byte to be compared. @return the value 0 if the argument Byte is equal to this Byte; a value less than 0 if this Byte is numerically less than the Byte argument; and a value greater than 0 if this Byte is numerically greater than the Byte argument (signed comparison). @since JDK11.2
Class Byte, int compareTo(Object)

Compares this Byte to another Object. If the Object is a Byte this function behaves like compareTo(Byte). Otherwise it throws a ClassCastException (as Bytes are comparable only to other Bytes). @param o the Object to be compared. @return the value 0 if the argument is a Byte numerically equal to this Byte; a value less than 0 if the argument is a Byte numerically greater than this Byte; and a value greater than 0 if the argument is a Byte numerically less than this Byte. @exception ClassCastException if the argument is not a Byte. @see java.lang.Comparable @since JDK11.2
Class Byte, Byte decode(String)

Decodes a String into a Byte. The String may representAccepts decimal hexadecimal and octal numbers in the following formats:
 [-] decimal constant [-] 0x hex constant [-] # hex constant [-] 0 octal constant 
The constant following an (optional) negative sign and/or "radix specifier" is parsed as by the Byte.parseByte method with the specified radix (10 8 or 16). This constant must be positive or a NumberFormatException will result. The result is made negative if first character of the specified String is the negative sign. No whitespace characters are permitted in the String
. @param nm the stringString to decode. @return the Byte represented by the specified string. @exception NumberFormatException if the String does not contain a parsable byte. @see java.lang.Byte#parseByte(String int)
Class Byte, byte parseByte(String)

Assuming the specified String represents a byte returns that byte's value. Throws an exception if the String cannot be parsed as a byte. The radix is assumed to be 10. @param s the String containing the byte @return the parsed value of the byte @exception NumberFormatException If the string does not contain a parsable byte.
Class Byte, byte parseByte(String, int)

Assuming the specified String represents a byte returns that byte's value. Throws an exception if the String cannot be parsed as a byte. @param s the String containing the byte @param radix the radix to be used @return the parsed value of the byte @exception NumberFormatException If the String does not contain a parsable byte.
Class Byte, String toString(byte)

Returns a new String object representing the specified Byte. The radix is assumed to be 10. @param b the byte to be converted @return the string representation of the specified byte
Class Byte, Byte valueOf(String)

Assuming the specified String represents a byte returns a new Byte object initialized to that value. Throws an exception if the String cannot be parsed as a byte. The radix is assumed to be 10. @param s the String containing the integer @return the Byte instance representing the parsed byte value @exception NumberFormatException If the String does not contain a parsable byte.
Class Byte, Byte valueOf(String, int)

Assuming the specified String represents a byte returns a new Byte object initialized to that value. Throws an exception if the String cannot be parsed as a byte. @param s the String containing the integer @param radix the radix to be used @return the Byte instance representing the parsed byte value @exception NumberFormatException If the String does not contain a parsable byte.

Class Character

The Character class wraps a value of the primitive type char in an object. An object of type Character contains a single field whose type is char.

In addition this class provides several methods for determining the type of a character and converting characters from uppercase to lowercase and vice versa.

Many of the methods of class Character are defined in terms of a "Unicode attribute table" that specifies a name for every defined Unicode code point. The table also includes other attributes such as a decimal value an uppercase equivalent a lowercase equivalent and/or a titlecase equivalent. The character attribute tables for specific versions of Unicode are available on the World Wide Web in various subdirectories of:

 ftp://ftp.unicode.org/Public/ 

For a more detailed specification of the Character class one that encompasses the exact behavior of methods such as isDigit isLetter isLowerCase and isUpperCase over the full range of Unicode values see Gosling Joy and Steele The Java Language Specification. @author Lee Boynton @author Guy Steele @author Akira Tanaka @version 1.55 9861 02/0902/1600 @since JDK1.0


Class Character.Subset

Instances of this class represent particular subsets of the Unicode character set. The only family of subsets defined in the Character class is {@link Character.UnicodeBlock UnicodeBlock}. Other portions of the Java API may define other subsets for their own purposes. @since JDK11.2

Class Character.UnicodeBlock

A family of character subsets representing the character blocks defined by the Unicode 2.0 specification. Any given character is contained by at most one Unicode block. @since JDK11.2

Class Character, int compareTo(Character)

Compares two Characters numerically. @param anotherCharacter the Character to be compared. @return the value 0 if the argument Character is equal to this Character; a value less than 0 if this Character is numerically less than the Character argument; and a value greater than 0 if this Character is numerically greater than the Character argument (unsigned comparison). Note that this is strictly a numerical comparison; it is not locale-dependent. @since JDK11.2
Class Character, int compareTo(Object)

Compares this Character to another Object. If the Object is a Character this function behaves like compareTo(Character). Otherwise it throws a ClassCastException (as Characters are comparable only to other Characters). @param o the Object to be compared. @return the value 0 if the argument is a Character numerically equal to this Character; a value less than 0 if the argument is a Character numerically greater than this Character; and a value greater than 0 if the argument is a Character numerically less than this Character. @exception ClassCastException if the argument is not a Character. @see java.lang.Comparable @since JDK11.2
Class Character, byte COMBINING_SPACING_MARK

Public data for enumerated Unicode general category types. @since JDK1.1
Class Character, byte CONNECTOR_PUNCTUATION

Public data for enumerated Unicode general category types. @since JDK1.1
Class Character, byte CONTROL

Public data for enumerated Unicode general category types. @since JDK1.1
Class Character, byte CURRENCY_SYMBOL

Public data for enumerated Unicode general category types. @since JDK1.1
Class Character, byte DASH_PUNCTUATION

Public data for enumerated Unicode general category types. @since JDK1.1
Class Character, byte DECIMAL_DIGIT_NUMBER

Public data for enumerated Unicode general category types. @since JDK1.1
Class Character, byte ENCLOSING_MARK

Public data for enumerated Unicode general category types. @since JDK1.1
Class Character, byte END_PUNCTUATION

Public data for enumerated Unicode general category types. @since JDK1.1
Class Character, byte FORMAT

Public data for enumerated Unicode general category types. @since JDK1.1
Class Character, byte LETTER_NUMBER

Public data for enumerated Unicode general category types. @since JDK1.1
Class Character, byte LINE_SEPARATOR

Public data for enumerated Unicode general category types. @since JDK1.1
Class Character, byte LOWERCASE_LETTER

Public data for enumerated Unicode general category types. @since JDK1.1
Class Character, byte MATH_SYMBOL

Public data for enumerated Unicode general category types. @since JDK1.1
Class Character, byte MODIFIER_LETTER

Public data for enumerated Unicode general category types. @since JDK1.1
Class Character, byte MODIFIER_SYMBOL

Public data for enumerated Unicode general category types. @since JDK1.1
Class Character, byte NON_SPACING_MARK

Public data for enumerated Unicode general category types. @since JDK1.1
Class Character, byte OTHER_LETTER

Public data for enumerated Unicode general category types. @since JDK1.1
Class Character, byte OTHER_NUMBER

Public data for enumerated Unicode general category types. @since JDK1.1
Class Character, byte OTHER_PUNCTUATION

Public data for enumerated Unicode general category types. @since JDK1.1
Class Character, byte OTHER_SYMBOL

Public data for enumerated Unicode general category types. @since JDK1.1
Class Character, byte PARAGRAPH_SEPARATOR

Public data for enumerated Unicode general category types. @since JDK1.1
Class Character, byte PRIVATE_USE

Public data for enumerated Unicode general category types. @since JDK1.1
Class Character, byte SPACE_SEPARATOR

Public data for enumerated Unicode general category types. @since JDK1.1
Class Character, byte START_PUNCTUATION

Public data for enumerated Unicode general category types. @since JDK1.1
Class Character, byte SURROGATE

Public data for enumerated Unicode general category types. @since JDK1.1
Class Character, byte TITLECASE_LETTER

Public data for enumerated Unicode general category types. @since JDK1.1
Class Character, byte UNASSIGNED

Public data for enumerated Unicode general category types. @since JDK1.1
Class Character, byte UPPERCASE_LETTER

Public data for enumerated Unicode general category types. @since JDK1.1

Class Class

Instances of the class Class represent classes and interfaces in a running Java application. Every array also belongs to a class that is reflected as a Class object that is shared by all arrays with the same element type and number of dimensions. The primitive Java types (boolean byte char short int long float and double) and the keyword void are also represented as Class objects.

Class has no public constructor. Instead Class objects are constructed automatically by the Java Virtual Machine as classes are loaded and by calls to the defineClass method in the class loader.

The following example uses a Class object to print the class name of an object:

 void printClassName(Object obj) { System.out.println("The class of " + obj + " is " + obj.getClass().getName()); } 
@author unascribed @version 1.100 04107 02/2202/9900 @see java.lang.ClassLoader#defineClass(byte[] int int) @since JDK1.0
Class Class, Class forName(String, boolean, ClassLoader)

Returns the Class object associated with the class or interface with the given string name using the given class loader. Given the fully qualified name for a class or interface (in the same format returned by getName) this method attempts to locate load and link the class or interface. The specified class loader is used to load the class or interface. If the parameter loader is null the class is loaded through the bootstrap class loader. The class is initialized only if the initialize parameter is true and if it has not been initialized earlier.

If name denotes a primitive type or void an attempt will be made to locate a user-defined class in the unnamed package whose name is name. Therefore this method cannot be used to obtain any of the Class objects representing primitive types or void.

If name denotes an array class the component type of the array class is loaded but not initialized.

For example in an instance method the expression:

 Class.forName("Foo") 
is equivalent to:
 Class.forName("Foo" true this.getClass().getClassLoader()) 
Note that this method throws errors related to loading linking or initializing as specified in Sections 12.2 12.3 and 12.4 of The Java Language Specification.

If the loader is null and a security manager is present and the caller's class loader is not null then this method calls the security manager's checkPermission method with a RuntimePermission("getClassLoader") permission to ensure it's ok to access the bootstrap class loader. @param name fully qualified name of the desired class @param initialize whether the class must be initialized @param loader class loader from which the class must be loaded @return class object representing the desired class @exception LinkageError if the linkage fails @exception ExceptionInInitializerError if the initialization provoked by this method fails @exception ClassNotFoundException if the class cannot be located by the specified class loader @see java.lang.Class#forName(String) @see java.lang.ClassLoader @since JDK11.2

Class Class, Class[] getClasses()

Returns an array containing Class objects representing all the public classes and interfaces that are members of the class represented by this Class object. This includes public class and interface members inherited from superclasses and public class and interface members declared by the class. This method returns an array of length 0 if this Class object has no public member classes or interfaces. This method also returns an array of length 0 if this Class object represents a primitive type an array class or void.

For this class and each of its superclasses the following security checks are performed: If there is a security manager the security manager's checkMemberAccess method is called with this and Member.PUBLIC as its arguments where this is this class or the superclass whose members are being determined. If the class is in a package then the security manager's checkPackageAccess method is also called with the package name as its argument. Either of these calls could result in a SecurityException. @return the array of Class objects representing the public members of this class @exception SecurityException if access to the information is denied. @see SecurityManager#checkMemberAccess(Class int) @see SecurityManager#checkPackageAccess(String) @since JDK1.1

Class Class, Class getComponentType()

Returns the Class representing the component type of an array. If this class does not represent an array class this method returns null. @return the Class representing the component type of this class if this class is an array @see java.lang.reflect.Array @since JDK1.1
Class Class, Constructor getConstructor(Class[])

Returns a Constructor object that reflects the specified public constructor of the class represented by this Class object. The parameterTypes parameter is an array of Class objects that identify the constructor's formal parameter types in declared order.

The constructor to reflect is the public constructor of the class represented by this Class object whose formal parameter types match those specified by parameterTypes.

If there is a security manager this method first calls the security manager's checkMemberAccess method with this and Member.PUBLIC as its arguments. If the class is in a package then this method also calls the security manager's checkPackageAccess method with the package name as its argument. Either of these calls could result in a SecurityException. @param parameterTypes the parameter array @return the Method object of the public constructor that matches the specified parameterTypes @exception NoSuchMethodException if a matching method is not found. @exception SecurityException if access to the information is denied. @see java.lang.reflect.Constructor @see SecurityManager#checkMemberAccess(Class int) @see SecurityManager#checkPackageAccess(String) @since JDK1.1

Class Class, Constructor[] getConstructors()

Returns an array containing Constructor objects reflecting all the public constructors of the class represented by this Class object. An array of length 0 is returned if the class has no public constructors or if the class is an array class or if the class reflects a primitive type or void.

If there is a security manager this method first calls the security manager's checkMemberAccess method with this and Member.PUBLIC as its arguments. If the class is in a package then this method also calls the security manager's checkPackageAccess method with the package name as its argument. Either of these calls could result in a SecurityException. @return the array containing Method objects for all the declared public constructors of this class matches the specified parameterTypes @exception SecurityException if access to the information is denied. @see java.lang.reflect.Constructor @see SecurityManager#checkMemberAccess(Class int) @see SecurityManager#checkPackageAccess(String) @since JDK1.1

Class Class, Class[] getDeclaredClasses()

Returns an array of Class objects reflecting all the classes and interfaces declared as members of the class represented by this Class object. This includes public protected default (package) access and private classes and interfaces declared by the class but excludes inherited classes and interfaces. This method returns an array of length 0 if the class declares no classes or interfaces as members or if this Class object represents a primitive type an array class or void.

If there is a security manager this method first calls the security manager's checkMemberAccess method with this and Member.DECLARED as its arguments. If the class is in a package then this method also calls the security manager's checkPackageAccess method with the package name as its argument. Either of these calls could result in a SecurityException. @return the array of Class objects representing all the declared members of this class @exception SecurityException if access to the information is denied. @see SecurityManager#checkMemberAccess(Class int) @see SecurityManager#checkPackageAccess(String) @since JDK1.1

Class Class, Constructor getDeclaredConstructor(Class[])

Returns a Constructor object that reflects the specified constructor of the class or interface represented by this Class object. The parameterTypes parameter is an array of Class objects that identify the constructor's formal parameter types in declared order.

If there is a security manager this method first calls the security manager's checkMemberAccess method with this and Member.DECLARED as its arguments. If the class is in a package then this method also calls the security manager's checkPackageAccess method with the package name as its argument. Either of these calls could result in a SecurityException. @param parameterTypes the parameter array @return The Method object for the constructor with the specified parameter list @exception NoSuchMethodException if a matching method is not found. @exception SecurityException if access to the information is denied. @see java.lang.reflect.Constructor @see SecurityManager#checkMemberAccess(Class int) @see SecurityManager#checkPackageAccess(String) @since JDK1.1

Class Class, Constructor[] getDeclaredConstructors()

Returns an array of Constructor objects reflecting all the constructors declared by the class represented by this Class object. These are public protected default (package) access and private constructors. The elements in the array returned are not sorted and are not in any particular order. If the class has a default constructor it is included in the returned array. This method returns an array of length 0 if this Class object represents an interface a primitive type an array class or void.

See The Java Language Specification section 8.2.

If there is a security manager this method first calls the security manager's checkMemberAccess method with this and Member.DECLARED as its arguments. If the class is in a package then this method also calls the security manager's checkPackageAccess method with the package name as its argument. Either of these calls could result in a SecurityException. @return the array of Method objects representing all the declared constructors of this class @exception SecurityException if access to the information is denied. @see java.lang.reflect.Constructor @see SecurityManager#checkMemberAccess(Class int) @see SecurityManager#checkPackageAccess(String) @since JDK1.1

Class Class, Field getDeclaredField(String)

Returns a Field object that reflects the specified declared field of the class or interface represented by this Class object. The name parameter is a String that specifies the simple name of the desired field. Note that this method will not reflect the length field of an array class.

If there is a security manager this method first calls the security manager's checkMemberAccess method with this and Member.DECLARED as its arguments. If the class is in a package then this method also calls the security manager's checkPackageAccess method with the package name as its argument. Either of these calls could result in a SecurityException. @param name the name of the field @return the Field object for the specified field in this class @exception NoSuchFieldException if a field with the specified name is not found. @exception SecurityException if access to the information is denied. @see java.lang.reflect.Field @see SecurityManager#checkMemberAccess(Class int) @see SecurityManager#checkPackageAccess(String) @since JDK1.1

Class Class, Field[] getDeclaredFields()

Returns an array of Field objects reflecting all the fields declared by the class or interface represented by this Class object. This includes public protected default (package) access and private fields but excludes inherited fields. The elements in the array returned are not sorted and are not in any particular order. This method returns an array of length 0 if the class or interface declares no fields or if this Class object represents a primitive type an array class or void.

See The Java Language Specification sections 8.2 and 8.3.

If there is a security manager this method first calls the security manager's checkMemberAccess method with this and Member.DECLARED as its arguments. If the class is in a package then this method also calls the security manager's checkPackageAccess method with the package name as its argument. Either of these calls could result in a SecurityException. @return the array of Field objects representing all the declared fields of this class @exception SecurityException if access to the information is denied. @see java.lang.reflect.Field @see SecurityManager#checkMemberAccess(Class int) @see SecurityManager#checkPackageAccess(String) @since JDK1.1

Class Class, Method getDeclaredMethod(String, Class[])

Returns a Method object that reflects the specified declared method of the class or interface represented by this Class object. The name parameter is a String that specifies the simple name of the desired method and the parameterTypes parameter is an array of Class objects that identify the method's formal parameter types in declared order. If more than one method with the same parameter types is declared in a class and one of these methods has a return type that is more specific than any of the others that method is returned; otherwise one of the methods is chosen arbitrarily. If the name is "<init>"or "<clinit>" a NoSuchMethodException is raised.

If there is a security manager this method first calls the security manager's checkMemberAccess method with this and Member.DECLARED as its arguments. If the class is in a package then this method also calls the security manager's checkPackageAccess method with the package name as its argument. Either of these calls could result in a SecurityException. @param name the name of the method @param parameterTypes the parameter array @return the Method object for the method of this class matching the specified name and parameters @exception NoSuchMethodException if a matching method is not found. @exception SecurityException if access to the information is denied. @see java.lang.reflect.Method @see SecurityManager#checkMemberAccess(Class int) @see SecurityManager#checkPackageAccess(String) @since JDK1.1

Class Class, Method[] getDeclaredMethods()

Returns an array of Method objects reflecting all the methods declared by the class or interface represented by this Class object. This includes public protected default (package) access and private methods but excludes inherited methods. The elements in the array returned are not sorted and are not in any particular order. This method returns an array of length 0 if the class or interface declares no methods or if this Class object represents a primitive type an array class or void. The class initialization method <clinit> is not included in the returned array. If the class declares multiple public member methods with the same parameter types they are all included in the returned array.

See The Java Language Specification section 8.2.

If there is a security manager this method first calls the security manager's checkMemberAccess method with this and Member.DECLARED as its arguments. If the class is in a package then this method also calls the security manager's checkPackageAccess method with the package name as its argument. Either of these calls could result in a SecurityException. @return the array of Method objects representing all the declared methods of this class @exception SecurityException if access to the information is denied. @see java.lang.reflect.Method @see SecurityManager#checkMemberAccess(Class int) @see SecurityManager#checkPackageAccess(String) @since JDK1.1

Class Class, Class getDeclaringClass()

If the class or interface represented by this Class object is a member of another class returns the Class object representing the class in which it was declared. This method returns null if this class or interface is not a member of any other class. If this Class object represents an array class a primitive type or void then this method returns null. @return the declaring class for this class @since JDK1.1
Class Class, Field getField(String)

Returns a Field object that reflects the specified public member field of the class or interface represented by this Class object. The name parameter is a String specifying the simple name of the desired field.

If there is a security manager this method first calls the security manager's checkMemberAccess method with this and Member.PUBLIC as its arguments. If the class is in a package then this method also calls the security manager's checkPackageAccess method with the package name as its argument. Either of these calls could result in a SecurityException.

The field to be reflected is determined by the algorithm that follows. Let C be the class represented by this object:

  1. If C declares a public field with the name specified that is the field to be reflected.
  2. If no field was found in step 1 above this algorithm is applied recursively to each direct superinterface of C. The direct superinterfaces are searched in the order they were declared.
  3. If no field was found in steps 1 and 2 above and C has a superclass S then this algorithm is invoked recursively upon S. If C has no superclass then a NoSuchFieldException is thrown.

See The Java Language Specification sections 8.2 and 8.3. @param name the field name @return the Field object of this class specified by name @exception NoSuchFieldException if a field with the specified name is not found. @exception SecurityException if access to the information is denied. @see java.lang.reflect.Field @see SecurityManager#checkMemberAccess(Class int) @see SecurityManager#checkPackageAccess(String) @since JDK1.1

Class Class, Field[] getFields()

Returns an array containing Field objects reflecting all the accessible public fields of the class or interface represented by this Class object. The elements in the array returned are not sorted and are not in any particular order. This method returns an array of length 0 if the class or interface has no accessible public fields or if it represents an array class a primitive type or void.

Specifically if this Class object represents a class this method returns the public fields of this class and of all its superclasses. If this Class object represents an interface this method returns the fields of this interface and of all its superinterfaces.

If there is a security manager this method first calls the security manager's checkMemberAccess method with this and Member.PUBLIC as its arguments. If the class is in a package then this method also calls the security manager's checkPackageAccess method with the package name as its argument. Either of these calls could result in a SecurityException.

The implicit length field for array classs is not reflected by this method. User code should use the methods of class Array to manipulate arrays.

See The Java Language Specification sections 8.2 and 8.3. @return the array of Field objects representing the public fields @exception SecurityException if access to the information is denied. @see java.lang.reflect.Field @see SecurityManager#checkMemberAccess(Class int) @see SecurityManager#checkPackageAccess(String) @since JDK1.1

Class Class, Method getMethod(String, Class[])

Returns a Method object that reflects the specified public member method of the class or interface represented by this Class object. The name parameter is a String specifying the simple name the desired method. The parameterTypes parameter is an array of Class objects that identify the method's formal parameter types in declared order. If parameterTypes is null it is treated as if it were an empty array.

If there is a security manager this method first calls the security manager's checkMemberAccess method with this and Member.PUBLIC as its arguments. If the class is in a package then this method also calls the security manager's checkPackageAccess method with the package name as its argument. Either of these calls could result in a SecurityException.

If the name is "<init>"or "<clinit>" a NoSuchMethodException is raised. Otherwise the method to be reflected is determined by the algorithm that follows. Let C be the class represented by this object:

  1. C is searched for any matching methods. If no matching method is found the algorithm of step 1 is invoked recursively on the superclass of C.
  2. If no method was found in step 1 above the superinterfaces of C are searched for a matching method. If any such method is found it is reflected.
To find a matching method in a class C:  If C declares exactly one public method with the specified name and exactly the same formal parameter types that is the method reflected. If more than one such method is found in C and one of these methods has a return type that is more specific than any of the others that method is reflected; otherwise one of the methods is chosen arbitrarily.

See The Java Language Specification sections 8.2 and 8.4. @param name the name of the method @param parameterTypes the list of parameters @return the Method object that matches the specified name and parameterTypes @exception NoSuchMethodException if a matching method is not found or if then name is "<init>"or "<clinit>". @exception SecurityException if access to the information is denied. @see java.lang.reflect.Method @see SecurityManager#checkMemberAccess(Class int) @see SecurityManager#checkPackageAccess(String) @since JDK1.1

Class Class, Method[] getMethods()

Returns an array containing Method objects reflecting all the public member methods of the class or interface represented by this Class object including those declared by the class or interface and and those inherited from superclasses and superinterfaces. The elements in the array returned are not sorted and are not in any particular order. This method returns an array of length 0 if this Class object represents a class or interface that has no public member methods or if this Class object represents an array class primitive type or void.

If there is a security manager this method first calls the security manager's checkMemberAccess method with this and Member.PUBLIC as its arguments. If the class is in a package then this method also calls the security manager's checkPackageAccess method with the package name as its argument. Either of these calls could result in a SecurityException.

The class initialization method <clinit> is not included in the returned array. If the class declares multiple public member methods with the same parameter types they are all included in the returned array.

See The Java Language Specification sections 8.2 and 8.4. @return the array of Method objects representing the public methods of this class @exception SecurityException if access to the information is denied. @see java.lang.reflect.Method @see SecurityManager#checkMemberAccess(Class int) @see SecurityManager#checkPackageAccess(String) @since JDK1.1

Class Class, int getModifiers()

Returns the Java language modifiers for this class or interface encoded in an integer. The modifiers consist of the Java Virtual Machine's constants for public protected private final static abstract and interface; they should be decoded using the methods of class Modifier.

If the underlying class is an array class then its public private and protected modifiers are the same as those of its component type. If this Class represents a primitive type or void its public modifier is always true and its protected and private modifers are always false. If this object represents an array class a primitive type or void then its final modifier is always true and its interface modifer is always false. The values of its other modifiers are not determined by this specification.

The modifier encodings are defined in The Java Virtual Machine Specification table 4.1. @return the int representing the modifiers for this class @see java.lang.reflect.Modifier @since JDK1.1

Class Class, ProtectionDomain getProtectionDomain()

Returns the ProtectionDomain of this class. If there is a security manager installed this method first calls the security manager's checkPermission method with a RuntimePermission("getProtectionDomain") permission to ensure it's ok to get the ProtectionDomain. @return the ProtectionDomain of this class @throws SecurityException if a security manager exists and its checkPermission method doesn't allow geting the ProtectionDomain. @see java.security.ProtectionDomain @see SecurityManager#checkPermission @see java.lang.RuntimePermission @since JDK11.2
Class Class, boolean isAssignableFrom(Class)

Determines if the class or interface represented by this Class object is either the same as or is a superclass or superinterface of the class or interface represented by the specified Class parameter. It returns true if so; otherwise it returns false. If this Class object represents a primitive type this method returns true if the specified Class parameter is exactly this Class object; otherwise it returns false.

Specifically this method tests whether the type represented by the specified Class parameter can be converted to the type represented by this Class object via an identity conversion or via a widening reference conversion. See The Java Language Specification sections 5.1.1 and 5.1.4 for details. @param cls the Class object to be checked @return the boolean value indicating whether objects of the type cls can be assigned to objects of this class @exception NullPointerException if the specified Class parameter is null. @since JDK1.1

Class Class, boolean isInstance(Object)

Determines if the specified Object is assignment-compatible with the object represented by this Class. This method is the dynamic equivalent of the Java language instanceof operator. The method returns true if the specified Object argument is non-null and can be cast to the reference type represented by this Class object without raising a ClassCastException. It returns false otherwise.

Specifically if this Class object represents a declared class this method returns true if the specified Object argument is an instance of the represented class (or of any of its subclasses); it returns false otherwise. If this Class object represents an array class this method returns true if the specified Object argument can be converted to an object of the array class by an identity conversion or by a widening reference conversion; it returns false otherwise. If this Class object represents an interface this method returns true if the class or any superclass of the specified Object argument implements this interface; it returns false otherwise. If this Class object represents a primitive type this method returns false. @param obj the object to check @return true if obj is an instance of this class @since JDK1.1

Class Class, boolean isPrimitive()

Determines if the specified Class object represents a primitive type.

There are nine predefined Class objects to represent the eight primitive types and void. These are created by the Java Virtual Machine and have the same names as the primitive types that they represent namely boolean byte char short int long float and double.

These objects may only be accessed via the following public static final variables and are the only Class objects for which this method returns true. @return true if and only if this class represents a primitive type @see java.lang.Boolean#TYPE @see java.lang.Character#TYPE @see java.lang.Byte#TYPE @see java.lang.Short#TYPE @see java.lang.Integer#TYPE @see java.lang.Long#TYPE @see java.lang.Float#TYPE @see java.lang.Double#TYPE @see java.lang.Void#TYPE @since JDK1.1


Class ClassCastException

Thrown to indicate that the code has attempted to cast an object to a subclass of which it is not an instance. For example the following code generates a ClassCastException:

 Object x = new Integer(0); System.out.println((String)x); 
@author unascribed @version 1.15 0917 02/2102/9800 @since JDK1.0

Class ClassCircularityError

Thrown when a circularity has been detected while initializing a class. @author unascribed @version 1.10 0912 02/2102/9800 @since JDK1.0

Class ClassFormatError

Thrown when the Java Virtual Machine attempts to read a class file and determines that the file is malformed or otherwise cannot be interpreted as a class file. @author unascribed @version 1.15 0917 02/2102/9800 @since JDK1.0

Class ClassLoader

The class ClassLoader is an abstract class. A class loader is an object that is responsible for loading classes. Given the name of a class it should attempt to locate or generate data that constitutes a definition for the class. A typical strategy is to transform the name into a file name and then read a "class file" of that name from a file system.

Every Class object contains a reference to the ClassLoader that defined it.

Class objects for array classes are not created by class loaders but are created automatically as required by the Java runtime. The class loader for an array class as returned by Class#getClassLoader() is the same as the class loader for its element type; if the element type is a primitive type then the array class has no class loader.

Applications implement subclasses of ClassLoader in order to extend the manner in which the Java virtual machine dynamically loads classes.

Class loaders may typically be used by security managers to indicate security domains.

The ClassLoader class uses a delegation model to search for classes and resources. Each instance of ClassLoader has an associated parent class loader. When called upon to find a class or resource a ClassLoader instance will delegate the search for the class or resource to its parent class loader before attempting to find the class or resource itself. The virtual machine's built-in class loader called the bootstrap class loader does not itself have a parent but may serve as the parent of a ClassLoader instance.

Normally the Java virtual machine loads classes from the local file system in a platform-dependent manner. For example on UNIX systems the virtual machine loads classes from the directory defined by the CLASSPATH environment variable.

However some classes may not originate from a file; they may originate from other sources such as the network or they could be constructed by an application. The method defineClass converts an array of bytes into an instance of class Class. Instances of this newly defined class can be created using the newInstance method in class Class.

The methods and constructors of objects created by a class loader may reference other classes. To determine the class(es) referred to the Java virtual machine calls the loadClass method of the class loader that originally created the class.

For example an application could create a network class loader to download class files from a server. Sample code might look like:

 ClassLoader loader = new NetworkClassLoader(host  port); Object main = loader.loadClass("Main" true).newInstance();  . . . 

The network class loader subclass must define the methods findClass and loadClassData to load a class from the network. Once it has downloaded the bytes that make up the class it should use the method defineClass to create a class instance. A sample implementation is:


 class NetworkClassLoader extends ClassLoader { String host; int port; public Class findClass(String name) { byte[] b = loadClassData(name); return defineClass(name b 0 b.length); } private byte[] loadClassData(String name) { // load the class data from the connection  . . . } } 

@version 1.129 05142 02/1917/00 @see java.lang.Class @see java.lang.Class#newInstance() @see java.lang.ClassLoader#defineClass(byte[] int int) @see java.lang.ClassLoader#loadClass(java.lang.String boolean) @see java.lang.ClassLoader#resolveClass(java.lang.Class) @since JDK1.0
Class ClassLoader, constructor ClassLoader(ClassLoader)

Creates a new class loader using the specified parent class loader for delegation.

If there is a security manager its checkCreateClassLoader method is called. This may result in a security exception. @throws SecurityException if a security manager exists and its checkCreateClassLoader method doesn't allow creation of a new class loader. @param parent the parent class loader @see java.lang.SecurityException @see java.lang.SecurityManager#checkCreateClassLoader() @since JDK11.2

Class ClassLoader, Class defineClass(String, byte[], int, int, ProtectionDomain)

Converts an array of bytes into an instance of class Class with an optional ProtectionDomain. If the domain is null then a default domain will be assigned to the class as specified in the documentation for byte[ int int)}. Before the class can be used it must be resolved.

The first class defined in a package determines the exact set of certificates that all subsequent classes defined in that package must contain. The set of certificates for a class is obtained from the CodeSource within the ProtectionDomain of the class. Any classes added to that package must contain the same set of certificates or a SecurityException will be thrown. Note that if the name argument is null this check is not performed. You should always pass in the name of the class you are defining as well as the bytes. This ensures that the class you are defining is indeed the class you think it is.

The specified class name cannot begin with "java." since all classes in the java.* packages can only be defined by the bootstrap class loader. @exception ClassFormatError if the data did not contain a valid class @exception IndexOutOfBoundsException if either off or len is negative or if off+len is greater than b.length. @exception SecurityException if an attempt is made to add this class to a package that contains classes that were signed by a different set of certificates thenthan this class or if the class name begins with "java.". @param name the name of the class @param b the class bytes @param off the start offset of the class bytes @param len the length of the class bytes @param protectionDomain the ProtectionDomain of the class @return the Class object created from the data and optional ProtectionDomain.

Class ClassLoader, Package definePackage(String, String, String, String, String, String, String, URL)

Defines a package by name in this ClassLoader. This allows class loaders to define the packages for their classes. Packages must be created before the class is defined and package names must be unique within a class loader and cannot be redefined or changed once created. @param name the package name @param specTitle the specification title @param specVersion the specification version @param specVendor the specification vendor @param implTitle the implementation title @param implVersion the implementation version @param implVendor the implementation vendor @param sealBase If not null then this package is sealed with respect to the given code source URL. Otherwise the package is not sealed. @return the newly defined Package object @exception IllegalArgumentException if package name duplicates an existing package either in this class loader or one of its ancestors @since JDK11.2
Class ClassLoader, Class findClass(String)

Finds the specified class. This method should be overridden by class loader implementations that follow the new delegation model for loading classes and will be called by the loadClass method after checking the parent class loader for the requested class. The default implementation throws ClassNotFoundException. @param name the name of the class @return the resulting Class object @exception ClassNotFoundException if the class could not be found @since JDK11.2
Class ClassLoader, String findLibrary(String)

Returns the absolute path name of a native library. The VM invokes this method to locate the native libraries that belong to classes loaded with this class loader. If this method returns null the VM searches the library along the path specified as the java.library.path property. @param libname the library name @return the absolute path of the native library @see java.lang.System#loadLibrary(java.lang.String) @see java.lang.System#mapLibraryName(java.lang.String) @since JDK11.2
Class ClassLoader, URL findResource(String)

Finds the resource with the given name. Class loader implementations should override this method to specify where to find resources. @param name the resource name @return a URL for reading the resource or null if the resource could not be found @since JDK11.2
Class ClassLoader, Enumeration findResources(String)

Returns an Enumeration of URLs representing all the resources with the given name. Class loader implementations should override this method to specify where to load resources from. @param name the resource name @return an Enumeration of URLs for the resources @throws IOException if I/O errors occur @since JDK11.2
Class ClassLoader, Class findSystemClass(String)

Finds a class with the specified name loading it if necessary.

Prior to JDK1.the Java 2 SDK this method loads a class from the local file system in a platform-dependent manner and returns a class object that has no associated class loader.

Since JDK1the Java 2 SDK v1.2 this method loads the class through the system class loader(see Clas objects returned might have ClassLoaders associated with them. Subclasses of ClassLoader need not usually call this method because most class loaders need to override just @separa #ClassLoader(ClassLoader) @see #getParent() @param name the name of the class that is to be found @return athe systemClass class withobject for the givenspecified name @exception ClassNotFoundException if the class could not be found @see #ClassLoader(ClassLoader) @see #getParent()

Class ClassLoader, Package getPackage(String)

Returns a Package that has been defined by this class loader or any of its ancestors. @param name the package name @return the Package corresponding to the given name or null if not found @since JDK11.2
Class ClassLoader, Package[] getPackages()

Returns all of the Packages defined by this class loader and its ancestors. @return the array of Package objects defined by this ClassLoader @since JDK11.2
Class ClassLoader, ClassLoader getParent()

Returns the parent class loader for delegation. Some implementations may use null to represent the bootstrap class loader. This method will return null in such implementations if this class loader's parent is the bootstrap class loader.

If a security manager is present and the caller's class loader is not null and is not an ancestor of this class loader then this method calls the security manager's checkPermission method with a RuntimePermission("getClassLoader") permission to ensure it's ok to access the parent class loader. If not a SecurityException will be thrown. @return the parent ClassLoader @throws SecurityException if a security manager exists and its checkPermission method doesn't allow access to this class loader's parent class loader. @see SecurityManager#checkPermission @see java.lang.RuntimePermission @since JDK11.2

Class ClassLoader, Enumeration getResources(String)

Finds all the resources with the given name. A resource is some data (images audio text etc) that can be accessed by class code in a way that is independent of the location of the code.

The name of a resource is a "/"-separated path name that identifies the resource.

The search order is described in the documentation for @para name resource name @return an enumeration of URL to the resource. If no resources could be found the enumeration will be empty. Resources that the doesn't have access to will not be in the enumeration. @throws IOException if I/O errors occur @since JDK11.2 @see #getResource @see #findResources

Class ClassLoader, ClassLoader getSystemClassLoader()

Returns the system class loader for delegation. This is the default delegation parent for new ClassLoader instances and is typically the class loader used to start the application.

If a security manager is present and the caller's class loader is not null and the caller's class loader is not the same as or an ancestor of the system class loader then this method calls the security manager's checkPermission method with a RuntimePermission("getClassLoader") permission to ensure it's ok to access the system class loader. If not a SecurityException will be thrown. @return the system ClassLoader for delegation or null if none @throws SecurityException if a security manager exists and its checkPermission method doesn't allow access to the system class loader. @see SecurityManager#checkPermission @see java.lang.RuntimePermission @since JDK11.2

Class ClassLoader, URL getSystemResource(String)

Find a resource of the specified name from the search path used to load classes.

In JDK1.1 the search path used is that of the virtual machine's built-in class loader.

Since JDK1the Java 2 SDK v1.2 this method locates the resource through the system class loader (see @para name the resource name @return a URL for reading the resource or null if the resource could not be found @since JDK1.1

Class ClassLoader, Enumeration getSystemResources(String)

Finds all resources of the specified name from the search path used to load classes. The resources thus found are returned as an Enumeration of URL objects.

The search order is described in the documentation for #getSystemResource(String)

@param name the resource name @return an enumeration of resource URLs @throws IOException if I/O errors occur @since JDK11.2

Class ClassLoader, Class loadClass(String, boolean)

Loads the class with the specified name. The default implementation of this method searches for classes in the following order:

  1. Call #findLoadedClass(String) to check if the class has already been loaded.

  2. Call the loadClass method on the parent class loader. If the parent is null the class loader built-in to the virtual machine is used instead.

  3. Call the #findClass(String) method to find the class.

If the class was found using the above steps and the resolve flag is true this method will then call the #resolveClass(Class) method on the resulting class object.

From JDK1the Java 2 SDK v1.2 subclasses of ClassLoader are encouraged to override #findClass(String) rather than this method.

@param name the name of the class @param resolve if true then resolve the class @return the resulting Class object @exception ClassNotFoundException if the class could not be found


Class ClassNotFoundException

Thrown when an application tries to load in a class through its string name using:

but no definition for the class with the specifed name could be found. @author unascribed @version 1.8 0513 02/0402/9800 @see java.lang.Class#forName(java.lang.String) @see java.lang.ClassLoader#findSystemClass(java.lang.String) @see java.lang.ClassLoader#loadClass(java.lang.String boolean) @since JDK1.0

Class ClassNotFoundException, constructor ClassNotFoundException(String, Throwable)

Constructs a ClassNotFoundException with the specified detail message and optional exception that was raised while loading the class. @param s the detail message @param ex the exception that was raised while loading the class @since JDK11.2
Class ClassNotFoundException, Throwable getException()

Returns the exception that was raised if an error occurred while attempting to load the class. Otherwise returns null. @return the Exception that was raised while loading a class @since JDK11.2

Class CloneNotSupportedException

Thrown to indicate that the clone method in class Object has been called to clone an object but that the object's class does not implement the Cloneable interface.

Applications that override the clone method can also throw this exception to indicate that an object could not or should not be cloned. @author unascribed @version 1.6 098 02/2102/9800 @see java.lang.Cloneable @see java.lang.Object#clone() @since JDK1.0


Class Cloneable

A class implements the Cloneable interface to indicate to the java.lang.Object#clone() method that it is legal for that method to make a field-for-field copy of instances of that class.

Attempts to clone instances that do not implement the Cloneable interface result in the exception CloneNotSupportedException being thrown.

The interface Cloneable declares no methods. @author unascribed @version 1.8 0910 02/2102/9800 @see java.lang.CloneNotSupportedException @since JDK1.0


Class Comparable

This interface imposes a total ordering on the objects of each class that implements it. This ordering is referred to as the class's natural ordering and the class's compareTo method is referred to as its natural comparison method.

Lists (and arrays) of objects that implement this interface can be sorted automatically by Collections.sort (and Arrays.sort). Objects that implement this interface can be used as keys in a sorted map or elements in a sorted set without the need to specify a comparator.

A class's natural ordering is said to be consistent with equals if and only if (e1.compareTo((Object)e2)==0) has the same boolean value as e1.equals((Object)e2) for every e1 and e2 of class C.

It is strongly recommended (though not required) that natural orderings be consistent with equals. This is so because sorted sets (and sorted maps) without explicit comparators behave "strangely" when they are used with elements (or keys) whose natural ordering is inconsistent with equals. In particular such a sorted set (or sorted map) violates the general contract for set (or map) which is defined in terms of the equals operation.

For example if one adds two keys a and b such that (a.equals((Object)b) && a.compareTo((Object)b) = 0) to a sorted set that does not use an explicit comparator the second add operation returns false (and the size of the sorted set does not increase) because a and b are equivalent from the sorted set's perspective.

Virtually all Java core classes that implement comparable have natural orderings that are consistent with equals. One exception is java.math.BigDecimal whose natural ordering equates BigDecimals with equal values and different precisions (such as 4.0 and 4.00).

For the mathematically inclined the relation that defines the natural ordering on a given class C is:

 {(x y) such that x.compareTo((Object)y) <= 0}. 
The quotient for this total order is:
 {(x y) such that x.compareTo((Object)y) == 0}. 
It follows immediately from the contract for compareTo that the quotient is an equivalence relation on C and that the natural ordering is a total order on C. When we say that a class's natural ordering is consistent with equals we mean that the quotient for the natural ordering is the equivalence relation defined by the class's equals(Object) method:
 {(x y) such that x.equals((Object)y)}. 
@author Josh Bloch @version 1.9 0913 02/3002/9800 @see java.util.Comparator @see java.util.Collections#sort(java.util.List) @see java.util.Arrays#sort(Object[]) @see java.util.SortedSet @see java.util.SortedMap @see java.util.TreeSet @see java.util.TreeMap @since JDK11.2

Class Compiler

The Compiler class is provided to support Java-to-native-code compilers and related services. By design the Compiler class does nothing; it serves as a placeholder for a JIT compiler implementation.

When the Java Virtual Machine first starts it determines if the system property java.compiler exists. (System properties are accessible through getProperty and a method defined by the System class.) If so it is assumed to be the name of a library (with a platform-dependent exact location and type); the loadLibrary method in class System is called to load that library. If this loading succeeds the function named java_lang_Compiler_start() in that library is called.

If no compiler is available these methods do nothing. @author Frank Yellin @version 1.12 0615 02/2902/9800 @see java.lang.System#getProperty(java.lang.String) @see java.lang.System#getProperty(java.lang.String java.lang.String) @see java.lang.System#loadLibrary(java.lang.String) @since JDK1.0


Class Double

The Double class wraps a value of the primitive type double in an object. An object of type Double contains a single field whose type is double.

In addition this class provides several methods for converting a double to a String and a String to a double as well as other constants and methods useful when dealing with a double. @author Lee Boynton @author Arthur van Hoff @version 1.54 0963 02/1102/9800 @since JDK1.0

Class Double, int compareTo(Double)

Compares two Doubles numerically. There are two ways in which comparisons performed by this method differ from those performed by the Java language numerical comparison operators (< <= == >= >) when applied to primitive doubles: This ensures that Double.compareTo(Object) (which inherits its behavior from this method) obeys the general contract for Comparable.compareTo and that the natural order on Doubles is total. @param anotherDouble the Double to be compared. @return the value 0 if anotherDouble is numerically equal to this Double; a value less than 0 if this Double is numerically less than anotherDouble; and a value greater than 0 if this Double is numerically greater than anotherDouble. @since JDK11.2 @see Comparable#compareTo(Object)
Class Double, int compareTo(Object)

Compares this Double to another Object. If the Object is a Double this function behaves like compareTo(Double). Otherwise it throws a ClassCastException (as Doubles are comparable only to other Doubles). @param o the Object to be compared. @return the value 0 if the argument is a Double numerically equal to this Double; a value less than 0 if the argument is a Double numerically greater than this Double; and a value greater than 0 if the argument is a Double numerically less than this Double. @exception ClassCastException if the argument is not a Double. @see java.lang.Comparable @since JDK11.2
Class Double, int hashCode()

Returns a hashcode for this Double object. The result is the exclusive OR of the two halves of the long integer bit representation exactly as produced by the method #doubleToLongBits(double) of the primitive double value represented by this Double object. That is the hashcode is the value of the expression:
 (int)(v^(v>>>32)) 
where v is defined by:
 long v = Double.doubleToLongBits(this.longValuedoubleValue()); 
@return a hash code value for this object.
Class Double, double longBitsToDouble(long)

Returns the double-float corresponding to a given bit represention. The argument is considered to be a representation of a floating-point value according to the IEEE 754 floating-point "double precision" bit layout. That floating-point value is returned as the result.

If the argument is 0x7ff0000000000000L the result is positive infinity.

If the argument is 0xfff0000000000000L the result is negative infinity.

If the argument is any value in the range 0x7ff0000000000001L through 0x7fffffffffffffffL or in the range 0xfff0000000000001L through 0xffffffffffffffffL the result is NaN. All IEEE 754 NaN values of type double are in effect lumped together by the Java programming language into a single value called NaN. Distinct values of NaN are only accessible by use of the Double.doubleToRawLongBits method.

In all other cases let s e and m be three values that can be computed from the argument:

 int s = ((bits >> 63) == 0) 1 : -1; int e = (int)((bits >> 52) & 0x7ffL); long m = (e == 0) (bits & 0xfffffffffffffL) < 1 : (bits & 0xfffffffffffffL) | 0x10000000000000L; 
Then the floating-point result equals the value of the mathematical expression s·m·2e-1075. @param bits any long integer. @return the double floating-point value with the same bit pattern.
Class Double, double parseDouble(String)

Returns a new double initialized to the value represented by the specified String as performed by the valueOf method of class Double. @param s the string to be parsed. @return the double value represented by the string argument. @exception NumberFormatException if the string does not contain a parsable double. @see java.lang.Double#valueOf(String) @since JDK11.2
Class Double, String toString(double)

Creates a string representation of the double argument. All characters mentioned below are ASCII characters.

How many digits must be printed for the fractional part of m or a There must be at least one digit to represent the fractional part and beyond that as many but only as many more digits as are needed to uniquely distinguish the argument value from adjacent values of type double. That is suppose that x is the exact mathematical value represented by the decimal representation produced by this method for a finite nonzero argument d. Then d must be the double value nearest to x; or if two double values are equally close to x then d must be one of them and the least significant bit of the significand of d must be 0. @param d the double to be converted. @return a string representation of the argument.


Class Error

An Error is a subclass of Throwable that indicates serious problems that a reasonable application should not try to catch. Most such errors are abnormal conditions. The ThreadDeath error though a "normal" condition is also a subclass of Error because most applications should not try to catch it.

A method is not required to declare in its throws clause any subclasses of Error that might be thrown during the execution of the method but not caught since these errors are abnormal conditions that should never occur. @author Frank Yellin @version 1.10 0912 02/2102/9800 @see java.lang.ThreadDeath @since JDK1.0


Class Exception

The class Exception and its subclasses are a form of Throwable that indicates conditions that a reasonable application might want to catch. @author Frank Yellin @version 1.25 0927 02/2102/9800 @see java.lang.Error @since JDK1.0

Class ExceptionInInitializerError

Signals that an unexpected exception has occurred in a static initializer. An ExceptionInInitializerError is thrown to indicate that an exception occurred during evaluation of a static initializer or the initializer for a static variable. @author Frank Yellin @version 1.9 0811 02/2502/9800 @since JDK1.1

Class Float

The Float class wraps a value of primitive type float in an object. An object of type Float contains a single field whose type is float.

In addition this class provides several methods for converting a float to a String and a String to a float as well as other constants and methods useful when dealing with a float. @author Lee Boynton @author Arthur van Hoff @version 1.48 0760 02/2302/9800 @since JDK1.0

Class Float, int compareTo(Float)

Compares two Floats numerically. There are two ways in which comparisons performed by this method differ from those performed by the Java language numerical comparison operators (< <= == >= >) when applied to primitive floats: This ensures that Float.compareTo(Object) (which inherits its behavior from this method) obeys the general contract for Comparable.compareTo and that the natural order on Floats is total. @param anotherFloat the Float to be compared. @return the value 0 if anotherFloat is numerically equal to this Float; a value less than 0 if this Float is numerically less than anotherFloat; and a value greater than 0 if this Float is numerically greater than anotherFloat. @since JDK11.2 @see Comparable#compareTo(Object)
Class Float, int compareTo(Object)

Compares this Float to another Object. If the Object is a Float this function behaves like compareTo(Float). Otherwise it throws a ClassCastException (as Floats are comparable only to other Floats). @param o the Object to be compared. @return the value 0 if the argument is a Float numerically equal to this Float; a value less than 0 if the argument is a Float numerically greater than this Float; and a value greater than 0 if the argument is a Float numerically less than this Float. @exception ClassCastException if the argument is not a Float. @see java.lang.Comparable @since JDK11.2
Class Float, boolean equals(Object)

Compares this object against some other object. The result is true if and only if the argument is not null and is a Float object that represents a float that has the identical bit pattern to the bit pattern of the float represented by this object. For this purpose two float values are considered to be the same if and only if the method #floatToIntBits(float) returns the same int value when applied to each.

Note that in most cases for two instances of class Float f1 and f2 the value of f1.equals(f2) is true if and only if

 f1.floatValue() == f2.floatValue() 

also has the value true. However there are two exceptions:

This definition allows hashtables to operate properly. @param obj the object to be compared @return true if the objects are the same; false otherwise. @see java.lang.Float#floatToIntBits(float)
Class Float, float intBitsToFloat(int)

Returns the single-float corresponding to a given bit represention. The argument is considered to be a representation of a floating-point value according to the IEEE 754 floating-point "single precision" bit layout.

If the argument is 0x7f800000 the result is positive infinity.

If the argument is 0xff800000 the result is negative infinity.

If the argument is any value in the range 0x7f800001 through 0x7fffffff or in the range 0xff800001 through 0xffffffff the result is NaN. All IEEE 754 NaN values of type float are in effect lumped together by the Java programming language into a single float value called NaN. Distinct values of NaN are only accessible by use of the Float.floatToRawIntBits method.

In all other cases let s e and m be three values that can be computed from the argument:

 int s = ((bits >> 31) == 0) 1 : -1; int e = ((bits >> 23) & 0xff); int m = (e == 0) (bits & 0x7fffff) < 1 : (bits & 0x7fffff) | 0x800000; 
Then the floating-point result equals the value of the mathematical expression s·m·2e-150. @param bits an integer. @return the single-format floating-point value with the same bit pattern.
Class Float, float parseFloat(String)

Returns a new float initialized to the value represented by the specified String as performed by the valueOf method of class Double. @param s the string to be parsed. @return the float value represented by the string argument. @exception NumberFormatException if the string does not contain a parsable float. @see java.lang.Double#valueOf(String) @since JDK11.2

Class IllegalAccessError

Thrown if an application attempts to access or modify a field or to call a method that it does not have access to.

Normally this error is caught by the compiler; this error can only occur at run time if the definition of a class has incompatibly changed. @author unascribed @version 1.11 0913 02/2102/9800 @since JDK1.0


Class IllegalAccessException

Thrown when an application tries to load in a class through its string name using: The forName method in class Class. The findSystemClass method in class ClassLoader. The loadClass method in class ClassLoader. but the currently executing method does not have access to the definition of the specified class because the class is not public and in another package.

An instance of this class can also be thrown when an application tries to create an instance of a class using the newInstance method in class Class but the current method does not have access to the appropriate zero-argument constructor. @author unascribed @version 1.6 099 02/2102/9800 @see java.lang.Class#forName(java.lang.String) @see java.lang.Class#newInstance() @see java.lang.ClassLoader#findSystemClass(java.lang.String) @see java.lang.ClassLoader#loadClass(java.lang.String boolean) @since JDK1.0


Class IllegalArgumentException

Thrown to indicate that a method has been passed an illegal or inappropriate argument. @author unascribed @version 1.15 0917 02/2102/9800 @see java.lang.Thread#setPriority(int) @since JDK1.0

Class IllegalMonitorStateException

Thrown to indicate that a thread has attempted to wait on an object's monitor or to notify other threads waiting on an object's monitor without owning the specified monitor. @author unascribed @version 1.7 099 02/2102/9800 @see java.lang.Object#notify() @see java.lang.Object#notifyAll() @see java.lang.Object#wait() @see java.lang.Object#wait(long) @see java.lang.Object#wait(long int) @since JDK1.0

Class IllegalStateException

Signals that a method has been invoked at an illegal or inappropriate time. In other words the Java environment or Java application is not in an appropriate state for the requested operation. @author Jonni Kanerva @version 1.7 099 02/2102/9800 @since JDK1.1

Class IllegalThreadStateException

Thrown to indicate that a thread is not in an appropriate state for the requested operation. See for example the suspend and resume methods in class Thread. @author unascribed @version 1.16 0918 02/2102/9800 @see java.lang.Thread#resume() @see java.lang.Thread#suspend() @since JDK1.0