// Error.Java
class Error {
public static class NestedError1 extends RuntimeException {
public NestedError1(String cause) {
super(String.format("runtime faii: %s", cause));
}
}
public static class UnsupportedVersion extends IllegalArgumentException {
public UnsupportedVersion(Exception err) {
super("UnsupportedVersion", err);
}
}
}
// HelloWorld.java
class HelloWorld {
public static void main(String[] args) throws Error.NestedError1 {
int t = 1;
if (t == 1) {
throw new Error.UnsupportedVersion(new Exception("1.0 incomplitable with 1.2"));
} else if (t == 2) {
throw new Error.NestedError1("Wooohala");
} else {
System.out.println("Hello, World!");
}
}
}