System.getSecurityManager() in Java

System.getSecurityManager(): This method is available in java.lang.System class of Java.

Syntax:

SecurityManager java.lang.System.getSecurityManager()

This method gets the system-wide security manager.

Parameters: NA

Returns: If a security manager has already been established for thecurrent application, then that security manager is returned; otherwise, null is returned.

Exceptions: NA

Approach

Java

public class SystemgetSecurityManager {
    public static void main(String[] args) {

        System.out.println(System.getSecurityManager());
    }
}

Output:

null

No comments:

Post a Comment