News:

Choose a design and let our professionals help you build a successful website   - ITAcumens

Main Menu

SocketPermission HashCode() Example

Started by VelMurugan, Dec 19, 2008, 11:51 PM

Previous topic - Next topic

VelMurugan

SocketPermission HashCode() Example

Returns the hash code value for this object.

SocketPermissionclass HashCode() method example. This example shows you how to use HashCode() method.This method Returns the hash code value for this object.

Here is the code:-


/**
* @Program that Returns the hash code value for this object.
* HashCode.java
* Author:-RoseIndia Team
* Date:-27-jun-2008
*/
import java.net.*;
import java.io.*;
import java.util.*;

public class HashCode {

    public static void main(String[] args) {
        String host = "www.catalog.com";
        String action = "connect";
        SocketPermission permission = new SocketPermission(host, action);
        System.out.println("Hash code value for this object is: "
                +permission.hashCode());
    }
}


Output of the program:-

Hash code value for this object is: -942608299

source : codingdiary