SecurityManager exception
Code Java:
import java.lang.*;
public class java17_test extends SecurityManager{
/**
* @param args
*/
public static void main(String[] args) {
System.setSecurityManager(new securityHouse());
System.exit(1);
}
}
class securityHouse extends SecurityManager{
public void house(){
checkExit(1);
}
}
I expected to get a SecurityException as soona as I invoked the System.exit(1) method but I failed to get one..
Is my logic right?
Re: SecurityManager exception
What does the house() method do? Who calls it?
Re: SecurityManager exception
You need to have a security configuration file with this as well or override some methods on the SecurityManager that check to see if you're allowed to call System.exit(int);
// Json