에서하는 System.exit()를 무시, 다른 클래스
public class ClassOne {
public static void main(String... args) {
System.exit(1);
}
}
다음 클래스는 ClassOne.main가 호출 된 후에 할 수있는 다른 일이있는 가정도 파괴됩니다.
public class ClassTwo {
public static void main(String... args) {
ClassOne.main(args);
Thread.sleep(30000);
}
}
System.exit (1)을 무시할 수있는 방법이 있습니까? ClassOw의 호출에서 ClassOne의?
가능한 복제본 [Java : System.exit()을 호출하는 메서드를 테스트하는 방법?] (http://stackoverflow.com/questions/309396/java-how-to-test-methods-that-call-system) -exit) –