a = ABCDEFGHIJ
b = ABCDEFGHIJ
a = AABCDEFGHI
b = BCDEFGHIJJ
Environment Properties
The following properties are available:
file.separator java.specification.version java.vm.version
java.class.path java.vendor line.separator
java.class.version java.vendor.url os.arch
java.compiler java.version os.name
java.ext.dirs java.vm.name os.version
java.home java.vm.specification.name path.separator
java.io.tmpdir java.vm.specification.vendor user.dir
java.librar y.path java.vm.specification.version user.home
java.specification.name java.vm.vendor user.name
java.specification.vendor
You can obtain the values of various environment variables by calling the
System.getProperty( )method. For example, the following program displays the
path to the current user directory:
class ShowUserDir {
public static void main(String args[]) {
System.out.println(System.getProperty("user.dir"));
}
}
Object
As mentioned in Part I,Objectis a superclass of all other classes.Objectdefines the
methods shown in Table 16-14, which are available to every object.
412 Part II: The Java Library
Method Description
Object clone( )
throws
CloneNotSupportedException
Creates a new object that is the same as the
invoking object.
boolean equals(Objectobject) Returnstrueif the invoking object is equivalent to
object.
void finalize( )
throws Throwable
Defaultfinalize( )method. This is usually overridden
by subclasses.
TABLE 16-14 The Methods Defined byObject