OnJava8-Examples/assertions/LoaderAssertions.java

19 lines
412 B
Java
Raw Normal View History

2015-05-05 11:20:13 -07:00
//: assertions/LoaderAssertions.java
2015-05-29 14:18:51 -07:00
// <20>2015 MindView LLC: see Copyright.txt
2015-05-05 11:20:13 -07:00
// 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()";
}
} ///:~