Saturday, 28 July 2012

Hashcode Example


class hash {
public static void main(String args[]) {
        String s1="world";
        String s2="Hello";
System.out.println("The hash code for " + s1 + " is " + s1.hashCode());
System.out.println("The hash code for " + s2 + " is " + s2.hashCode());
}
}

No comments:

Post a Comment