Example usage for java.lang Package isSealed

List of usage examples for java.lang Package isSealed

Introduction

In this page you can find the example usage for java.lang Package isSealed.

Prototype

public boolean isSealed(URL url) 

Source Link

Document

Returns true if this package is sealed with respect to the specified code source url .

Usage

From source file:Main.java

public static void main(String[] args) {
    try {//  w  w  w  .  j a v a 2s.c  o  m
        // get the java lang package
        Package pack = Package.getPackage("java.lang");

        // check if this package is sealed
        URL url = new URL("http://www.oracle.com");
        System.out.println("" + pack.isSealed(url));
    } catch (MalformedURLException ex) {
        ex.printStackTrace();
    }

}