Java System .setSecurityManager ( SecurityManager s)

Syntax

System.setSecurityManager(SecurityManager s) has the following syntax.

public static void setSecurityManager(SecurityManager s)

Example

In the following code shows how to use System.setSecurityManager(SecurityManager s) method.


//from  w  ww.  j a  v a 2s  . c o m

public class Main {

  public static void main(String[] args) throws Exception {

    if (System.getSecurityManager() == null) {
      System.setSecurityManager(new SecurityManager());
    }
  }
}




















Home »
  Java Tutorial »
    java.lang »




Boolean
Byte
Character
Class
Double
Enum
Float
Integer
Long
Math
Number
Object
Package
Process
ProcessBuilder
Runnable
Runtime
SecurityManager
Short
StackTraceElement
StrictMath
String
StringBuffer
StringBuilder
System
Thread
ThreadGroup
ThreadLocal
Throwable