Java Data Type Tutorial - 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 av a2  s  .  c o  m
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.