Java FilePermission hashCode() Example
FilePermission class hashCode() method example. This example shows you how to use hashCode() method.
Syntax is : public int hashCode()
This method returns the hash code value for this object.
Here is the code.
/**
* @(#) HashCodeFilePermission.java
* A class representing use of method hashCode() of FilePermission
class in java.io Package.
* @Version 08-June-2008
* @author Rose India Team
*/
import java.io.*;
public class HashCodeFilePermission {
public static void main(String[] args) throws IOException {
// create object of FilePermission class.
FilePermission objFP1 = new FilePermission("Mahendra.txt","read");
// hashCode() method call.
int hashCode = objFP1.hashCode();
System.out.println("hash code of object objFP1 is : " + hashCode);
}
} |
Output of the program.
| hash code of object objFP1 is : 147877428 |
|