18 lines
371 B
Java
18 lines
371 B
Java
//: assertions/LoaderAssertions.java
|
|
// Using the class loader to enable assertions
|
|
// {ThrowsException}
|
|
|
|
public class LoaderAssertions {
|
|
public static void main(String[] args) {
|
|
ClassLoader.getSystemClassLoader()
|
|
.setDefaultAssertionStatus(true);
|
|
new Loaded().go();
|
|
}
|
|
}
|
|
|
|
class Loaded {
|
|
public void go() {
|
|
assert false: "Loaded.go()";
|
|
}
|
|
} ///:~
|