¿¹Á¦

public static class ThrowableSubclass extends Throwable {
public ThrowableSubclass( String s ){
super(s);
}
}

public class Example {
public void run() throws ThrowableSubclass {
throw new ThrowableSubclass( "Problem" ); //$NON-NLS-1$
}
}

¼Ö·ç¼Ç
java.lang.ExceptionÀ» È®ÀåÇϽʽÿÀ.

public static class ExceptionSubclass extends Exception {
public ExceptionSubclass( String s ){
super(s);
}
}

public class Example {
public void run() throws ExceptionSubclass {
throw new ExceptionSubclass( "Problem" ); //$NON-NLS-1$
}
}