Java System.getSecurityManager()
Syntax
System.getSecurityManager() has the following syntax.
public static SecurityManager getSecurityManager()
Example
In the following code shows how to use System.getSecurityManager() method.
//from ww w.j a v a 2s .com
public class Main {
public static void main(String[] args) {
SecurityManager s = System.getSecurityManager();
if(s == null) {
System.out.println("SecurityManager not established!");
}
}
}
The code above generates the following result.