Java Reference
In-Depth Information
public boolean java.lang.Boolean.booleanValue()
public
static
boolean
java.lang.Boolean.getBoolean(java.lang.String)
public
static
boolean
java.lang.Boolean.parseBoolean(java.lang.String)
public
final
native
java.lang.Class
java.lang.Object.getClass()
public final native void java.lang.Object.notify()
public final native void java.lang.Object.notifyAll()
public final void java.lang.Object.wait(long,int) throws
java.lang.InterruptedException
public
final
void
java.lang.Object.wait()
throws
java.lang.InterruptedException
public final native void java.lang.Object.wait(long)
throws
java.lang.InterruptedException
}
Theoutputrevealsthedifferencebetweencalling getDeclaredMethods() and
getMethods() . For example, the output associated with getDeclaredMeth-
ods() includes the private toBoolean() method. Also, the output associated with
getMethods() includes Object methods that are not overridden by Boolean ;
getClass() is an example.
Oneof Table4-3 ' smethodsnotdemonstratedin Listing4-10 is newInstance() ,
whichisusefulforinstantiatingadynamicallyloadedclass,providedthattheclasshas
a noargument constructor.
Supposeyouplantocreateaviewerapplicationthatletstheuserviewdifferentkinds
of files. For example, the viewer can view the instruction sequence of a disassembled
WindowsEXEfile,thegraphicalcontentsofaPNGfile,orthecontentsofsomeother
file. Furthermore, the user can choose to view this content in its normal state (disas-
sembly versus graphical image, for example), in an informational manner (descriptive
labelsandcontent;forexample,EXEHEADER:MZ),orasatableofhexadecimalval-
ues.
The viewer application will start out with a few viewers, but you plan to add more
viewersovertime.Youdon'twanttointegratetheviewersourcecodewiththeapplic-
ation source code because you would have to recompile the application and all of its
viewers every time you added a new viewer (for example, a viewer that lets you view
the contents of a Java classfile).
Search WWH ::




Custom Search