Java The Complete Reference, Seventh Edition

(Greg DeLong) #1

Void


TheVoidclass has one field,TYPE, which holds a reference to theClassobject for typevoid.
You do not create instances of this class.

Process


The abstractProcessclass encapsulates aprocess—that is, an executing program. It is used
primarily as a superclass for the type of objects created byexec( )in theRuntimeclass, or
bystart( )in theProcessBuilderclass.Processcontains the abstract methods shown in
Table 16-10.

Chapter 16: Exploring java.lang 403


Method Description
static boolean
getBoolean(StringpropertyName)

Returnstrueif the system property specified by
propertyNameistrue. Other wise, it returnsfalse.
int hashCode( ) Returns the hash code for the invoking object.
static boolean parseBoolean(Stringstr) Returnstrueifstrcontains the string “true”. Case is
not significant. Other wise, returnsfalse.
String toString( ) Returns the string equivalent of the invoking object.
static String toString(booleanboolVal) Returns the string equivalent ofboolVal.
static Boolean valueOf(booleanboolVal) Returns theBooleanequivalent ofboolVal.
static Boolean valueOf(StringboolString) ReturnstrueifboolStringcontains the string “true” (in
uppercase or lowercase). Other wise, it returnsfalse.

TABLE 16-9 The Methods Defined byBoolean(continued)

Method Description
void destroy( ) Terminates the process.
int exitValue( ) Returns an exit code obtained from a subprocess.
InputStream getErrorStream( ) Returns an input stream that reads input from the process’
erroutput stream.
InputStream getInputStream( ) Returns an input stream that reads input from the process’
outoutput stream.
OutputStream getOutputStream( ) Returns an output stream that writes output to the process’
ininput stream.
int waitFor( )
throws InterruptedException

Returns the exit code returned by the process. This method
does not return until the process on which it is called
terminates.

TABLE 16-10 The Methods Defined byProcess
Free download pdf