Java FilePermission.hashCode()

Syntax

FilePermission.hashCode() has the following syntax.

public int hashCode()

Example

In the following code shows how to use FilePermission.hashCode() method.


/*  www . j  a  v  a  2  s  . co m*/
import java.io.FilePermission;
import java.io.IOException;

public class Main {
  public static void main(String[] args) throws IOException {

    FilePermission fp = new FilePermission("C://test.txt", "read");

    // the hash code value
    int hash = fp.hashCode();

    System.out.print("Hash Code: " + hash);

  }
}

The code above generates the following result.