Book Home Java Enterprise in a Nutshell Search this book

Chapter 12. The java.lang Package

The java.lang package contains the classes that are most central to the Java language. As you can see from Figure 12-1, the class hierarchy is broad rather than deep, which means that the classes are independent of each other.

figure

Figure 12-1. The java.lang package

Object is the ultimate superclass of all Java classes and is therefore at the top of all class hierarchies. Class is a class that describes a Java class. There is one Class object for each class that is loaded into Java.

Boolean, Character, Byte, Short, Integer, Long, Float, and Double are immutable class wrappers around each of the primitive Java data types. These classes are useful when you need to manipulate primitive types as objects. They also contain useful conversion and utility methods. String and StringBuffer are objects that represent strings. String is an immutable type, while StringBuffer can have its string changed in place. In Java 1.2 and later, all these classes (except StringBuffer) implement the Comparable interface, which enables sorting and searching algorithms. The Math class (and, in Java 1.3, the StrictMath class) defines static methods for various floating-point mathematical functions.

The Thread class provides support for multiple threads of control running within the same Java interpreter. The Runnable interface is implemented by objects that have a run() method that can serve as the body of a thread.

System provides low-level system methods. Runtime provides similar low-level methods, including an exec() method that, along with the Process class, defines an API for running external processes.

Throwable is the root class of the exception and error hierarchy. Throwable objects are used with the Java throw and catch statements. java.lang defines quite a few subclasses of Throwable. Exception and Error are the superclasses of all exceptions and errors. Figure 12-2 and Figure 12-3 show the class hierarchies for these core Java exceptions and errors.

figure

Figure 12-2. The exception classes in the java.lang package

figure

Figure 12-3. The error classes in the java.lang package

AbstractMethodErrorJava 1.0
java.langserializable error PJ1.1

Signals an attempt to invoke an abstract method.

public class AbstractMethodError extends IncompatibleClassChangeError {
// Public Constructors
public AbstractMethodError ();
public AbstractMethodError (String s);
}

Hierarchy: Object-->Throwable(Serializable)-->Error-->LinkageError-->IncompatibleClassChangeError-->AbstractMethodError

ArithmeticExceptionJava 1.0
java.langserializable unchecked PJ1.1

A RuntimeException that signals an exceptional arithmetic condition, such as integer division by zero.

public class ArithmeticException extends RuntimeException {
// Public Constructors
public ArithmeticException ();
public ArithmeticException (String s);
}

Hierarchy: Object-->Throwable(Serializable)-->Exception-->RuntimeException-->ArithmeticException

ArrayIndexOutOfBoundsExceptionJava 1.0
java.langserializable unchecked PJ1.1

Signals that an array index less than zero or greater than or equal to the array size has been used.

public class ArrayIndexOutOfBoundsException extends IndexOutOfBoundsException {
// Public Constructors
public ArrayIndexOutOfBoundsException ();
public ArrayIndexOutOfBoundsException (String s);
public ArrayIndexOutOfBoundsException (int index);
}

Hierarchy: Object-->Throwable(Serializable)-->Exception-->RuntimeException-->IndexOutOfBoundsException-->ArrayIndexOutOfBoundsException

Thrown By: Too many methods to list.

ArrayStoreExceptionJava 1.0
java.langserializable unchecked PJ1.1

Signals an attempt to store the wrong type of object into an array.

public class ArrayStoreException extends RuntimeException {
// Public Constructors
public ArrayStoreException ();
public ArrayStoreException (String s);
}

Hierarchy: Object-->Throwable(Serializable)-->Exception-->RuntimeException-->ArrayStoreException

BooleanJava 1.0
java.langserializable PJ1.1

This class provides an immutable object wrapper around the boolean primitive type. Note that the TRUE and FALSE constants are Boolean objects; they are not the same as the true and falseboolean values. As of Java 1.1, this class defines a Class constant that represents the boolean type. booleanValue() returns the boolean value of a Boolean object. The class method getBoolean() retrieves the boolean value of a named property from the system property list. The class method valueOf() parses a string and returns the boolean value it represents.

public final class Boolean implements Serializable {
// Public Constructors
public Boolean (boolean value);
public Boolean (String s);
// Public Constants
public static final Boolean FALSE ;
public static final Boolean TRUE ;
1.1public static final Class TYPE ;
// Public Class Methods
public static boolean getBoolean (String name);
public static Boolean valueOf (String s);
// Public Instance Methods
public boolean booleanValue ();
// Public Methods Overriding Object
public boolean equals (Object obj);
public int hashCode ();
public String toString ();
}

Hierarchy: Object-->Boolean(Serializable)

Passed To: javax.swing.DefaultDesktopManager.setWasIcon()

Returned By: Boolean.valueOf(), javax.swing.filechooser.FileView.isTraversable()

Type Of: java.awt.font.TextAttribute.{RUN_DIRECTION_LTR, RUN_DIRECTION_RTL, STRIKETHROUGH_ON, SWAP_COLORS_ON}, Boolean.{FALSE, TRUE}

ByteJava 1.1
java.langserializable comparable PJ1.1

This class provides an object wrapper around the byte primitive type. It defines useful constants for the minimum and maximum values that can be stored by the byte type and a Class object constant that represents the byte type. It also provides various methods for converting Byte values to and from strings and other numeric types.

Most of the static methods of this class can convert a String to a Byte object or a byte value: the four parseByte() and valueOf() methods parse a number from the specified string using an optionally specified radix and return it in one of these two forms. The decode() method parses a byte specified in base 10, base 8, or base 16 and returns it as a Byte. If the string begins with "0x" or "#", it is interpreted as a hexadecimal number. If it begins with "0", it is interpreted as an octal number. Otherwise, it is interpreted as a decimal number.

Note that this class has two toString() methods. One is static and converts a byte primitive value to a string; the other is the usual toString() method that converts a Byte object to a string. Most of the remaining methods convert a Byte to various primitive numeric types.

public final class Byte extends Number implements Comparable {
// Public Constructors
public Byte (byte value);
public Byte (String s) throws NumberFormatException;
// Public Constants
public static final byte MAX_VALUE ; =127
public static final byte MIN_VALUE ; =-128
public static final Class TYPE ;
// Public Class Methods
public static Byte decode (String nm) throws NumberFormatException;
public static byte parseByte (String s) throws NumberFormatException;
public static byte parseByte (String s, int radix) throws NumberFormatException;
public static String toString (byte b);
public static Byte valueOf (String s) throws NumberFormatException;
public static Byte valueOf (String s, int radix) throws NumberFormatException;
// Public Instance Methods
1.2public int compareTo (Byte anotherByte);
// Methods Implementing Comparable
1.2public int compareTo (Object o);
// Public Methods Overriding Number
public byte byteValue ();
public double doubleValue ();
public float floatValue ();
public int intValue ();
public long longValue ();
public short shortValue ();
// Public Methods Overriding Object
public boolean equals (Object obj);
public int hashCode ();
public String toString ();
}

Hierarchy: Object-->Number(Serializable)-->Byte(Comparable)

Passed To: Byte.compareTo()

Returned By: Byte.{decode(), valueOf()}

CharacterJava 1.0
java.langserializable comparable PJ1.1

This class provides an immutable object wrapper around the primitive char data type. charValue() returns the char value of a Character object. A number of class methods provide the Java/Unicode equivalent of the C <ctype.h> character macros for checking the type of characters and converting to uppercase and lowercase letters. getType() returns the character type. The return value is one of the constants defined by the class, which represents a number of broad Unicode character categories. digit() returns the integer equivalent of a given character for a given radix (e.g., radix 16 for hexadecimal). forDigit() returns the character that corresponds to the specified value for the specified radix.

public final class Character implements ComparableSerializable {
// Public Constructors
public Character (char value);
// Public Constants
1.1public static final byte COMBINING_SPACING_MARK ; =8
1.1public static final byte CONNECTOR_PUNCTUATION ; =23
1.1public static final byte CONTROL ; =15
1.1public static final byte CURRENCY_SYMBOL ; =26
1.1public static final byte DASH_PUNCTUATION ; =20
1.1public static final byte DECIMAL_DIGIT_NUMBER ; =9
1.1public static final byte ENCLOSING_MARK ; =7
1.1public static final byte END_PUNCTUATION ; =22
1.1public static final byte FORMAT ; =16
1.1public static final byte LETTER_NUMBER ; =10
1.1public static final byte LINE_SEPARATOR ; =13
1.1public static final byte LOWERCASE_LETTER ; =2
1.1public static final byte MATH_SYMBOL ; =25
public static final int MAX_RADIX ; =36
public static final char MAX_VALUE ; ='\uFFFF'
public static final int MIN_RADIX ; =2
public static final char MIN_VALUE ; ='\0'
1.1public static final byte MODIFIER_LETTER ; =4
1.1public static final byte MODIFIER_SYMBOL ; =27
1.1public static final byte NON_SPACING_MARK ; =6
1.1public static final byte OTHER_LETTER ; =5
1.1public static final byte OTHER_NUMBER ; =11
1.1public static final byte OTHER_PUNCTUATION ; =24
1.1public static final byte OTHER_SYMBOL ; =28
1.1public static final byte PARAGRAPH_SEPARATOR ; =14
1.1public static final byte PRIVATE_USE ; =18
1.1public static final byte SPACE_SEPARATOR ; =12
1.1public static final byte START_PUNCTUATION ; =21
1.1public static final byte SURROGATE ; =19
1.1public static final byte TITLECASE_LETTER ; =3
1.1public static final Class TYPE ;
1.1public static final byte UNASSIGNED ; =0
1.1public static final byte UPPERCASE_LETTER ; =1
// Inner Classes
1.2;
1.2;
// Public Class Methods
public static int digit (char ch, int radix);
public static char forDigit (int digit, int radix);
1.1public static int getNumericValue (char ch);
1.1public static int getType (char ch);
public static boolean isDefined (char ch);
public static boolean isDigit (char ch);
1.1public static boolean isIdentifierIgnorable (char ch);
1.1public static boolean isISOControl (char ch);
1.1public static boolean isJavaIdentifierPart (char ch);
1.1public static boolean isJavaIdentifierStart (char ch);
public static boolean isLetter (char ch);
public static boolean isLetterOrDigit (char ch);
public static boolean isLowerCase (char ch);
1.1public static boolean isSpaceChar (char ch);
public static boolean isTitleCase (char ch);
1.1public static boolean isUnicodeIdentifierPart (char ch);
1.1public static boolean isUnicodeIdentifierStart (char ch);
public static boolean isUpperCase (char ch);
1.1public static boolean isWhitespace (char ch);
public static char toLowerCase (char ch);
public static char toTitleCase (char ch);
public static char toUpperCase (char ch);
// Public Instance Methods
public char charValue ();
1.2public int compareTo (Character anotherCharacter);
// Methods Implementing Comparable
1.2public int compareTo (Object o);
// Public Methods Overriding Object
public boolean equals (Object obj);
public int hashCode ();
public String toString ();
// Deprecated Public Methods
#public static boolean isJavaLetter (char ch);
#public static boolean isJavaLetterOrDigit (char ch);
#public static boolean isSpace (char ch);
}

Hierarchy: Object-->Character(Comparable,Serializable)

Passed To: Character.compareTo()

Character.SubsetJava 1.2
java.lang

This class represents a named subset of the Unicode character set. The toString() method returns the name of the subset. This is a base class intended for further subclassing. Note, in particular, that it does not provide a way to list the members of the subset, nor a way to test for membership in the subset. See Character.UnicodeBlock.

public static class Character.Subset {
// Protected Constructors
protected Subset (String name);
// Public Methods Overriding Object
public final boolean equals (Object obj);
public final int hashCode ();
public final String toString ();
}

Subclasses: java.awt.im.InputSubset, Character.UnicodeBlock

Passed To: java.awt.im.InputContext.setCharacterSubsets(), java.awt.im.spi.InputMethod.setCharacterSubsets()

Character.UnicodeBlockJava 1.2
java.lang

This subclass of Character.Subset defines a number of constants that represent named subsets of the Unicode character set. The subsets and their names are the "character blocks" defined by the Unicode 2.0 specification (see http://www.unicode.org/ ). The static method of() takes a character and returns the Character.UnicodeBlock to which it belongs, or null if it is not part of any defined block. When presented with an unknown Unicode character, this method provides a useful way to determine what alphabet it belongs to.

public static final class Character.UnicodeBlock extends Character.Subset {
// No Constructor
// Public Constants
public static final Character.UnicodeBlock ALPHABETIC_PRESENTATION_FORMS ;
public static final Character.UnicodeBlock ARABIC ;
public static final Character.UnicodeBlock ARABIC_PRESENTATION_FORMS_A ;
public static final Character.UnicodeBlock ARABIC_PRESENTATION_FORMS_B ;
public static final Character.UnicodeBlock ARMENIAN ;
public static final Character.UnicodeBlock ARROWS ;
public static final Character.UnicodeBlock BASIC_LATIN ;
public static final Character.UnicodeBlock BENGALI ;
public static final Character.UnicodeBlock BLOCK_ELEMENTS ;
public static final Character.UnicodeBlock BOPOMOFO ;
public static final Character.UnicodeBlock BOX_DRAWING ;
public static final Character.UnicodeBlock CJK_COMPATIBILITY ;
public static final Character.UnicodeBlock CJK_COMPATIBILITY_FORMS ;
public static final Character.UnicodeBlock CJK_COMPATIBILITY_IDEOGRAPHS ;
public static final Character.UnicodeBlock CJK_SYMBOLS_AND_PUNCTUATION ;
public static final Character.UnicodeBlock CJK_UNIFIED_IDEOGRAPHS ;
public static final Character.UnicodeBlock COMBINING_DIACRITICAL_MARKS ;
public static final Character.UnicodeBlock COMBINING_HALF_MARKS ;
public static final Character.UnicodeBlock COMBINING_MARKS_FOR_SYMBOLS ;
public static final Character.UnicodeBlock CONTROL_PICTURES ;
public static final Character.UnicodeBlock CURRENCY_SYMBOLS ;
public static final Character.UnicodeBlock CYRILLIC ;
public static final Character.UnicodeBlock DEVANAGARI ;
public static final Character.UnicodeBlock DINGBATS ;
public static final Character.UnicodeBlock ENCLOSED_ALPHANUMERICS ;
public static final Character.UnicodeBlock ENCLOSED_CJK_LETTERS_AND_MONTHS ;
public static final Character.UnicodeBlock GENERAL_PUNCTUATION ;
public static final Character.UnicodeBlock GEOMETRIC_SHAPES ;
public static final Character.UnicodeBlock GEORGIAN ;
public static final Character.UnicodeBlock GREEK ;
public static final Character.UnicodeBlock GREEK_EXTENDED ;
public static final Character.UnicodeBlock GUJARATI ;
public static final Character.UnicodeBlock GURMUKHI ;
public static final Character.UnicodeBlock HALFWIDTH_AND_FULLWIDTH_FORMS ;
public static final Character.UnicodeBlock HANGUL_COMPATIBILITY_JAMO ;
public static final Character.UnicodeBlock HANGUL_JAMO ;
public static final Character.UnicodeBlock HANGUL_SYLLABLES ;
public static final Character.UnicodeBlock HEBREW ;
public static final Character.UnicodeBlock HIRAGANA ;
public static final Character.UnicodeBlock IPA_EXTENSIONS ;
public static final Character.UnicodeBlock KANBUN ;
public static final Character.UnicodeBlock KANNADA ;
public static final Character.UnicodeBlock KATAKANA ;
public static final Character.UnicodeBlock LAO ;
public static final Character.UnicodeBlock LATIN_1_SUPPLEMENT ;
public static final Character.UnicodeBlock LATIN_EXTENDED_A ;
public static final Character.UnicodeBlock LATIN_EXTENDED_ADDITIONAL ;
public static final Character.UnicodeBlock LATIN_EXTENDED_B ;
public static final Character.UnicodeBlock LETTERLIKE_SYMBOLS ;
public static final Character.UnicodeBlock MALAYALAM ;
public static final Character.UnicodeBlock MATHEMATICAL_OPERATORS ;
public static final Character.UnicodeBlock MISCELLANEOUS_SYMBOLS ;
public static final Character.UnicodeBlock MISCELLANEOUS_TECHNICAL ;
public static final Character.UnicodeBlock NUMBER_FORMS ;
public static final Character.UnicodeBlock OPTICAL_CHARACTER_RECOGNITION ;
public static final Character.UnicodeBlock ORIYA ;
public static final Character.UnicodeBlock PRIVATE_USE_AREA ;
public static final Character.UnicodeBlock SMALL_FORM_VARIANTS ;
public static final Character.UnicodeBlock SPACING_MODIFIER_LETTERS ;
public static final Character.UnicodeBlock SPECIALS ;
public static final Character.UnicodeBlock SUPERSCRIPTS_AND_SUBSCRIPTS ;
public static final Character.UnicodeBlock SURROGATES_AREA ;
public static final Character.UnicodeBlock TAMIL ;
public static final Character.UnicodeBlock TELUGU ;
public static final Character.UnicodeBlock THAI ;
public static final Character.UnicodeBlock TIBETAN ;
// Public Class Methods
public static Character.UnicodeBlock of (char c);
}

Returned By: Character.UnicodeBlock.of()

Type Of: Too many fields to list.

ClassJava 1.0
java.langserializable PJ1.1

This class represents a Java class or interface, or, as of Java 1.1, any Java type. There is one Class object for each class that is loaded into the Java Virtual Machine, and, as of Java 1.1, there are special Class objects that represent the Java primitive types. The TYPE constants defined by Boolean, Integer, and the other primitive wrapper classes hold these special Class objects. Array types are also represented by Class objects in Java 1.1.

There is no constructor for this class. You can obtain a Class object by calling the getClass() method of any instance of the desired class. In Java 1.1 and later, you can also refer to a Class object by appending .class to the name of a class. Finally, and most interestingly, a class can be dynamically loaded by passing its fully qualified name (i.e., package name plus class name) to the static Class.forName() method. This method loads the named class (if it is not already loaded) into the Java interpreter and returns a Class object for it. Classes can also be loaded with a ClassLoader object.

The newInstance() method creates an instance of a given class; this allows you to create instances of dynamically loaded classes for which you cannot use the new keyword. Note that this method only works when the target class has a no-argument constructor. See newInstance() in java.lang.reflect.Constructor for a more powerful way to instantiate dynamically loaded classes.

getName() returns the name of the class. getSuperclass() returns its superclass. isInterface() tests whether the Class object represents an interface, and getInterfaces() returns an array of the interfaces that this class implements. In Java 1.2 and later, getPackage() returns a Package object that represents the package containing the class. getProtectionDomain() returns the java.security.ProtectionDomain to which this class belongs. The various other get() and is() methods return other information about the represented class; they form part of the Java Reflection API, along with the classes in java.lang.reflect.

public final class Class implements Serializable {
// No Constructor
// Public Class Methods
public static Class forName (String className) throws ClassNotFoundException;
1.2public static Class forName (String name, boolean initialize, ClassLoader loader) throws ClassNotFoundException;
// Property Accessor Methods (by property name)
1.1public boolean isArray (); native
1.1public Class[ ] getClasses ();
public ClassLoader getClassLoader ();
1.1public Class getComponentType (); native
1.1public java.lang.reflect.Constructor[ ] getConstructors () throws SecurityException;
1.1public Class[ ] getDeclaredClasses () throws SecurityException;
1.1public java.lang.reflect.Constructor[ ] getDeclaredConstructors () throws SecurityException;
1.1public java.lang.reflect.Field[ ] getDeclaredFields () throws SecurityException;
1.1public java.lang.reflect.Method[ ] getDeclaredMethods () throws SecurityException;
1.1public Class getDeclaringClass (); native
1.1public java.lang.reflect.Field[ ] getFields () throws SecurityException;
public boolean isInterface (); native
public Class[ ] getInterfaces (); native
1.1public java.lang.reflect.Method[ ] getMethods () throws SecurityException;
1.1public int getModifiers (); native
public String getName (); native
1.2public Package getPackage ();
1.1public boolean isPrimitive (); native
1.2public java.security.ProtectionDomain getProtectionDomain ();
1.1public Object[ ] getSigners (); native
public Class getSuperclass (); native
// Public Instance Methods
1.1public java.lang.reflect.Constructor getConstructor (Class[ ] parameterTypes) throws NoSuchMethodExceptionSecurityException;
1.1public java.lang.reflect.Constructor getDeclaredConstructor (Class[ ] parameterTypes) throws NoSuchMethodExceptionSecurityException;
1.1public java.lang.reflect.Field getDeclaredField (String name) throws NoSuchFieldExceptionSecurityException;
1.1public java.lang.reflect.Method getDeclaredMethod (String name, Class[ ] parameterTypes) throws NoSuchMethodExceptionSecurityException;
1.1public java.lang.reflect.Field getField (String name) throws NoSuchFieldExceptionSecurityException;
1.1public java.lang.reflect.Method getMethod (String name, Class[ ] parameterTypes) throws NoSuchMethodExceptionSecurityException;
1.1public java.net.URL getResource (String name);
1.1public java.io.InputStream getResourceAsStream (String name);
1.1public boolean isAssignableFrom (Class cls); native
1.1public boolean isInstance (Object obj); native
public Object newInstance () throws InstantiationExceptionIllegalAccessException;
// Public Methods Overriding Object
public String toString ();
}

Hierarchy: Object-->Class(Serializable)

Passed To: Too many methods to list.

Returned By: Too many methods to list.

Type Of: java.beans.beancontext.BeanContextServiceAvailableEvent.serviceClass, java.beans.beancontext.BeanContextServiceRevokedEvent.serviceClass, Boolean.TYPE, Byte.TYPE, Character.TYPE, Double.TYPE, Float.TYPE, Integer.TYPE, Long.TYPE, Short.TYPE, Void.TYPE

ClassCastExceptionJava 1.0
java.langserializable unchecked PJ1.1

Signals an invalid cast of an object to a type of which it is not an instance.

public class ClassCastException extends RuntimeException {
// Public Constructors
public ClassCastException ();
public ClassCastException (String s);
}

Hierarchy: Object-->Throwable(Serializable)-->Exception-->RuntimeException-->ClassCastException

ClassCircularityErrorJava 1.0
java.langserializable error PJ1.1

Signals that a circular dependency has been detected while performing initialization for a class.

public class ClassCircularityError extends LinkageError {
// Public Constructors
public ClassCircularityError ();
public ClassCircularityError (String s);
}

Hierarchy: Object-->Throwable(Serializable)-->Error-->LinkageError-->ClassCircularityError

ClassFormatErrorJava 1.0
java.langserializable error PJ1.1

Signals an error in the binary format of a class file.

public class ClassFormatError extends LinkageError {
// Public Constructors
public ClassFormatError ();
public ClassFormatError (String s);
}

Hierarchy: Object-->Throwable(Serializable)-->Error-->LinkageError-->ClassFormatError

Subclasses: UnsupportedClassVersionError

Thrown By: ClassLoader.defineClass()

ClassLoaderJava 1.0
java.langPJ1.1

This class is the abstract superclass of objects that know how to load Java classes into a Java VM. Given a ClassLoader object, you can dynamically load a class by calling the public loadClass() method, specifying the full name of the desired class. You can obtain a resource associated with a class by calling getResource(), getResources(), and getResourceAsStream(). Many applications do not need to use ClassLoader directly; these applications use the Class.forName() and Class.getResource() methods to dynamically load classes and resources using the ClassLoader object that loaded the application itself.

In order to load classes over the network or from any source other than the standard system classes, you must use a custom ClassLoader object that knows how to obtain data from that source. A java.net.URLClassLoader is suitable for this purpose for almost all applications. Only rarely should an application need to define a ClassLoader subclass of its own. When this is necessary, the subclass should typically extend java.security.SecureClassLoader and override the findClass() method. This method must find the bytes that comprise the named class, then pass them to the defineClass() method and return the resulting Class object. In Java 1.2 and later, the findClass() method must also define the Package object associated with the class, if it has not already been defined. It can use getPackage() and definePackage() for this purpose. Custom subclasses of ClassLoader should also override findResource() and findResources() to enable the public getResource() and getResources() methods.

public abstract class ClassLoader {
// Protected Constructors
protected ClassLoader ();
1.2protected ClassLoader (ClassLoader parent);
// Public Class Methods
1.2public static ClassLoader getSystemClassLoader ();
1.1public static java.net.URL getSystemResource (String name);
1.1public static java.io.InputStream getSystemResourceAsStream (String name);
1.2public static java.util.Enumeration getSystemResources (String name) throws java.io.IOException;
// Public Instance Methods
1.2public final ClassLoader getParent ();
1.1public java.net.URL getResource (String name);
1.1public java.io.InputStream getResourceAsStream (String name);
1.2public final java.util.Enumeration getResources (String name) throws java.io.IOException;
1.1public Class loadClass (String name) throws ClassNotFoundException;
// Protected Instance Methods
1.1protected final Class defineClass (String name, byte[ ] b, int off, int len) throws ClassFormatError;
1.2protected final Class defineClass (String name, byte[ ] b, int off, int len, java.security.ProtectionDomain protectionDomain) throws ClassFormatError;
1.2protected Package definePackage (String name, String specTitle, String specVersion, String specVendor, String implTitle, String implVersion, String implVendor, java.net.URL sealBase) throws IllegalArgumentException;
1.2protected Class findClass (String name) throws ClassNotFoundException;
1.2protected String findLibrary (String libname); constant
1.1protected final Class findLoadedClass (String name); native
1.2protected java.net.URL findResource (String name); constant
1.2protected java.util.Enumeration findResources (String name) throws java.io.IOException;
protected final Class findSystemClass (String name) throws ClassNotFoundException;
1.2protected Package getPackage (String name);
1.2protected Package[ ] getPackages ();
protected Class loadClass (String name, boolean resolve) throws ClassNotFoundException; synchronized
protected final void resolveClass (Class c);
1.1protected final void setSigners (Class c, Object[ ] signers);
// Deprecated Protected Methods
#protected final Class defineClass (byte[ ] b, int off, int len) throws ClassFormatError;
}

Subclasses: java.security.SecureClassLoader

Passed To: Too many methods to list.

Returned By: Class.getClassLoader(), ClassLoader.{getParent(), getSystemClassLoader()}, SecurityManager.currentClassLoader(), Thread.getContextClassLoader(), java.rmi.server.RMIClassLoader.getClassLoader()

ClassNotFoundExceptionJava 1.0
java.langserializable checked PJ1.1

Signals that a class to be loaded cannot be found.

public class ClassNotFoundException extends Exception {
// Public Constructors
public ClassNotFoundException ();
public ClassNotFoundException (String s);
1.2public ClassNotFoundException (String s, Throwable ex);
// Public Instance Methods
1.2public Throwable getException (); default:null
// Public Methods Overriding Throwable
1.2public void printStackTrace ();
1.2public void printStackTrace (java.io.PrintWriter pw);
1.2public void printStackTrace (java.io.PrintStream ps);
}

Hierarchy: Object-->Throwable(Serializable)-->Exception-->ClassNotFoundException

Thrown By: Too many methods to list.

CloneableJava 1.0
java.langcloneable PJ1.1

This interface defines no methods or variables, but indicates that the class that implements it may be cloned (i.e., copied) by calling the Object method clone(). Calling clone() for an object that does not implement this interface (and does not override clone() with its own implementation) causes a CloneNotSupportedException to be thrown.

public interface Cloneable {
}

Implementations: Too many classes to list.

CloneNotSupportedExceptionJava 1.0
java.langserializable checked PJ1.1

Signals that the clone() method has been called for an object of a class that does not implement the Cloneable interface.

public class CloneNotSupportedException extends Exception {
// Public Constructors
public CloneNotSupportedException ();
public CloneNotSupportedException (String s);
}

Hierarchy: Object-->Throwable(Serializable)-->Exception-->CloneNotSupportedException

Subclasses: java.rmi.server.ServerCloneException

Thrown By: java.awt.datatransfer.DataFlavor.clone(), Object.clone(), java.rmi.server.UnicastRemoteObject.clone(), java.security.MessageDigest.clone(), java.security.MessageDigestSpi.clone(), java.security.Signature.clone(), java.security.SignatureSpi.clone(), javax.crypto.Mac.clone(), javax.crypto.MacSpi.clone(), javax.swing.AbstractAction.clone(), javax.swing.DefaultListSelectionModel.clone(), javax.swing.tree.DefaultTreeSelectionModel.clone()

ComparableJava 1.2
java.langcomparable

This interface defines a single method, compareTo(), that is responsible for comparing one object to another and determining their relative order, according to some natural ordering for that class of objects. Any general-purpose class that represents a value that can be sorted or ordered should implement this interface. Any class that does implement this interface can make use of various powerful methods such as java.util.Collections.sort() and java.util.Arrays.binarySearch(). As of Java 1.2, many of the key classes in the Java API have been modified to implement this interface.

The compareTo() object compares this object to the object passed as an argument. It should assume that the supplied object is of the appropriate type; if it is not, it should throw a ClassCastException. If this object is less than the supplied object or should appear before the supplied object in a sorted list, compareTo() should return a negative number. If this object is greater than the supplied object or should come after the supplied object in a sorted list, compareTo() should return a positive integer. If the two objects are equivalent, and their relative order in a sorted list does not matter, compareTo() should return 0. If compareTo() returns 0 for two objects, the equals() method should typically return true. If this is not the case, the Comparable objects are not suitable for use in java.util.TreeSet and java.util.TreeMap classes.

See java.util.Comparator for a way to define an ordering for objects that do not implement Comparable or to define an ordering other than the natural ordering defined by a Comparable class.

public interface Comparable {
// Public Instance Methods
public abstract int compareTo (Object o);
}

Implementations: java.io.File, java.io.ObjectStreamField, Byte, Character, Double, Float, Integer, Long, Short, String, java.math.BigDecimal, java.math.BigInteger, java.text.CollationKey, java.util.Date

CompilerJava 1.0
java.langPJ1.1

The static methods of this class provide an interface to the just-in-time (JIT) byte-code-to-native code compiler in use by the Java interpreter. If no JIT compiler is in use by the VM, these methods do nothing. compileClass() asks the JIT compiler to compile the specified class. compileClasses() asks the JIT compiler to compile all classes that match the specified name. These methods return true if the compilation was successful, or false if it failed or if there is no JIT compiler on the system. enable() and disable() turn just-in-time compilation on and off. command() asks the JIT compiler to perform some compiler-specific operation; this is a hook for vendor extensions. No standard operations have been defined.

public final class Compiler {
// No Constructor
// Public Class Methods
public static Object command (Object any); native
public static boolean compileClass (Class clazz); native
public static boolean compileClasses (String string); native
public static void disable (); native
public static void enable (); native
}
DoubleJava 1.0
java.langserializable comparable PJ1.1

This class provides an immutable object wrapper around the double primitive data type. valueOf() converts a string to a Double, doubleValue() returns the primitive double value of a Double object, and there are other methods for returning a Double value as a variety of other primitive types. This class also provides some useful constants and static methods for testing double values. MIN_VALUE and MAX_VALUE are the smallest (closest to zero) and largest representable double values. isInfinite() in class and instance method forms tests whether a double or a Double has an infinite value. Similarly, isNaN() tests whether a double or Double is not-a-number; this is a comparison that cannot be done directly because the NaN constant never tests equal to any other value, including itself. doubleToLongBits() and longBitsToDouble() allow you to manipulate the bit representation of a double directly.

public final class Double extends Number implements Comparable {
// Public Constructors
public Double (String s) throws NumberFormatException;
public Double (double value);
// Public Constants
public static final double MAX_VALUE ; =1.7976931348623157E308
public static final double MIN_VALUE ;
public static final double NaN ; =NaN
public static final double NEGATIVE_INFINITY ; =-Infinity
public static final double POSITIVE_INFINITY ; =Infinity
1.1public static final Class TYPE ;
// Public Class Methods
public static long doubleToLongBits (double value); native
1.3public static long doubleToRawLongBits (double value); native
public static boolean isInfinite (double v);
public static boolean isNaN (double v);
public static double longBitsToDouble (long bits); native
1.2public static double parseDouble (String s) throws NumberFormatException;
public static String toString (double d);
public static Double valueOf (String s) throws NumberFormatException;
// Public Instance Methods
1.2public int compareTo (Double anotherDouble);
public boolean isInfinite ();
public boolean isNaN ();
// Methods Implementing Comparable
1.2public int compareTo (Object o);
// Public Methods Overriding Number
1.1public byte byteValue ();
public double doubleValue ();
public float floatValue ();
public int intValue ();
public long longValue ();
1.1public short shortValue ();
// Public Methods Overriding Object
public boolean equals (Object obj);
public int hashCode ();
public String toString ();
}

Hierarchy: Object-->Number(Serializable)-->Double(Comparable)

Passed To: Double.compareTo()

Returned By: Double.valueOf()

ErrorJava 1.0
java.langserializable error PJ1.1

This class forms the root of the error hierarchy in Java. Subclasses of Error, unlike subclasses of Exception, should not be caught and generally cause termination of the program. Subclasses of Error need not be declared in the throws clause of a method definition. getMessage() returns a message associated with the error. See Throwable for other methods.

public class Error extends Throwable {
// Public Constructors
public Error ();
public Error (String s);
}

Hierarchy: Object-->Throwable(Serializable)-->Error

Subclasses: java.awt.AWTError, LinkageError, ThreadDeath, VirtualMachineError

Passed To: java.rmi.ServerError.ServerError()

ExceptionJava 1.0
java.langserializable checked PJ1.1

This class forms the root of the exception hierarchy in Java. An Exception signals an abnormal condition that must be specially handled to prevent program termination. Exceptions may be caught and handled. An exception that is not a subclass of RuntimeException must be declared in the throws clause of any method that can throw it. getMessage() returns a message associated with the exception. See Throwable for other methods.

public class Exception extends Throwable {
// Public Constructors
public Exception ();
public Exception (String s);
}

Hierarchy: Object-->Throwable(Serializable)-->Exception

Subclasses: Too many classes to list.

Passed To: Too many methods to list.

Returned By: java.awt.event.InvocationEvent.getException(), java.security.PrivilegedActionException.getException(), javax.ejb.EJBException.getCausedByException(), javax.jms.JMSException.getLinkedException(), org.omg.CORBA.Environment.exception()

Thrown By: java.rmi.server.RemoteCall.executeCall(), java.rmi.server.RemoteRef.invoke(), java.rmi.server.Skeleton.dispatch(), java.security.PrivilegedExceptionAction.run(), javax.naming.spi.NamingManager.getObjectInstance(), javax.naming.spi.ObjectFactory.getObjectInstance()

Type Of: java.io.WriteAbortedException.detail, java.rmi.server.ServerCloneException.detail

ExceptionInInitializerErrorJava 1.1
java.langserializable error PJ1.1

This error is thrown by the Java Virtual Machine when an exception occurs in the static initializer of a class. You can use the getException() method to obtain the Throwable object that was thrown from the initializer.

public class ExceptionInInitializerError extends LinkageError {
// Public Constructors
public ExceptionInInitializerError ();
public ExceptionInInitializerError (String s);
public ExceptionInInitializerError (Throwable thrown);
// Public Instance Methods
public Throwable getException (); default:null
// Public Methods Overriding Throwable
1.2public void printStackTrace ();
1.2public void printStackTrace (java.io.PrintWriter pw);
1.2public void printStackTrace (java.io.PrintStream ps);
}

Hierarchy: Object-->Throwable(Serializable)-->Error-->LinkageError-->ExceptionInInitializerError

FloatJava 1.0
java.langserializable comparable PJ1.1

This class provides an immutable object wrapper around the float primitive data type. valueOf() converts a string to a Float, floatValue() returns the primitive float value of a Float object, and there are methods for returning a Float value as a variety of other primitive types. This class also provides some useful constants and static methods for testing float values. MIN_VALUE and MAX_VALUE are the smallest (closest to zero) and largest representable double values. isInfinite() in class and instance method forms tests whether a float or a Float has an infinite value. Similarly, isNaN() tests whether a float or Float is not-a-number; this is a comparison that cannot be done directly because the NaN constant never tests equal to any other value, including itself. floatToIntBits() and intBitsToFloat() allow you to manipulate the bit representation of a float directly.

public final class Float extends Number implements Comparable {
// Public Constructors
public Float (String s) throws NumberFormatException;
public Float (float value);
public Float (double value);
// Public Constants
public static final float MAX_VALUE ; =3.4028235E38
public static final float MIN_VALUE ; =1.4E-45
public static final float NaN ; =NaN
public static final float NEGATIVE_INFINITY ; =-Infinity
public static final float POSITIVE_INFINITY ; =Infinity
1.1public static final Class TYPE ;
// Public Class Methods
public static int floatToIntBits (float value); native
1.3public static int floatToRawIntBits (float value); native
public static float intBitsToFloat (int bits); native
public static boolean isInfinite (float v);
public static boolean isNaN (float v);
1.2public static float parseFloat (String s) throws NumberFormatException;
public static String toString (float f);
public static Float valueOf (String s) throws NumberFormatException;
// Public Instance Methods
1.2public int compareTo (Float anotherFloat);
public boolean isInfinite ();
public boolean isNaN ();
// Methods Implementing Comparable
1.2public int compareTo (Object o);
// Public Methods Overriding Number
1.1public byte byteValue ();
public double doubleValue ();
public float floatValue ();
public int intValue ();
public long longValue ();
1.1public short shortValue ();
// Public Methods Overriding Object
public boolean equals (Object obj);
public int hashCode ();
public String toString ();
}

Hierarchy: Object-->Number(Serializable)-->Float(Comparable)

Passed To: Float.compareTo()

Returned By: Float.valueOf()

Type Of: Too many fields to list.

IllegalAccessErrorJava 1.0
java.langserializable error PJ1.1

Signals an attempted use of a class, method, or field that is not accessible.

public class IllegalAccessError extends IncompatibleClassChangeError {
// Public Constructors
public IllegalAccessError ();
public IllegalAccessError (String s);
}

Hierarchy: Object-->Throwable(Serializable)-->Error-->LinkageError-->IncompatibleClassChangeError-->IllegalAccessError

IllegalAccessExceptionJava 1.0
java.langserializable checked PJ1.1

Signals that a class or initializer is not accessible. Thrown by Class.newInstance().

public class IllegalAccessException extends Exception {
// Public Constructor