範例
public
class
ClassA {
public void
methodA {
//...
System.exit(0);
}
解決方案
改成擲出 RuntimeException。
public
class
ClassA {
public void
methodA
throws
RuntimeException {
//...
throw new
RuntimeException();
}