found first by the system class loader or the bootstrap loader.
Exercise 16.12: Modify your results for Exercise 16.11 to allow player strategies to use attached resources by
implementing findResource and findResources.
16.14. Controlling Assertions at Runtime
In Chapter 12 you learned about assertions and how they can be turned on or off through command-line
options that you pass to the virtual machine (see Section 12.10 on page 300). You can also affect assertion
evaluation from running code, although this is rarely required. You will probably need to do this only if you
are writing a harness for running other code and must provide your users with options to manage assertions.
Such manipulation is done with methods on ClassLoader:
public voidsetDefaultAssertionStatus(boolean enabled)
Sets the default assertion status for all classes loaded in this loader. Child
loaders are not affected, whether they exist at the time this method is invoked
or after. The initial default assertion status for a class loader is false.
public voidsetPackageAssertionStatus(String packageName,
boolean enabled)
Sets the default assertion status for all classes in the given package and it's
subpackages that are loaded in this loader. A null package name means the
unnamed package for this class loadersee Chapter 18, page 468.
public voidsetClassAssertionStatus(String className, boolean
enabled)
Sets the default assertion status for the given class and for all its nested
classes when loaded in this loader. You can only name top-level classes;
nested classes are turned off and on via their enclosing class.
public voidclearAssertionStatus()
Clears (turns off) all assertions for this class loader, wiping clear any
previous settings, whether from method invocations or the command line.
In all cases the settings only apply to classes that are loaded and initialized in the futureyou cannot change the
assertion status of a class once it has been loaded. More specifically, the assertion status of a class is
established during initialization: after initialization of the superclass, but before execution of any static
initializers.
As with the command-line options, the class-specific declarations have precedence over the package-specific
declarations, which in turn have precedence over the class loader's default status. In effect the command-line
options simply request the virtual machine to invoke the appropriate method on the class loader. So the
command-line options
-da:com.acme.Evaluator -ea:com.acme...