Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.util.PropertyPermission;

public class Main {

    public static void main(String[] args) {
        PropertyPermission permission = new PropertyPermission("java.*", "read,write");

        if (permission.implies(new PropertyPermission("java.home", "read"))) {
            System.out.println("Has permissions on " + "java.home" + " for read");
        }

        // Check permission on read action
        if (permission.implies(new PropertyPermission("java.home", "write"))) {
            System.out.println("Has permissions on " + "java.home" + " for write");
        }
    }
}