Sponsered Links
Categories
Sponsered Links

Java string class HashCode Method example

 

This is a simple Java string class HashCode Method example.

public class StringHashCode {
  public static void main(String args[]) {

    Integer j = new Integer(10);
    Long k = new Long(10);
    Integer v = new Integer(0);
   
    System.out.println("Return Value:  " + j.equals(k));
   
    System.out.println("Hash code number is:  " + j.hashCode()       "\nHash code number is:  " + k.hashCode());
   
    System.out.println("Method returns: " + v.hashCode());

    String str= "java jsp servlet tutorial";
   
    System.out.println("Return corresponding hash code value is:  "
        + str.hashCode());
  }

}

 
 
Sponsered Links
Latest Updates
 
All Content of this site is for learning only. We do not warrant the correctness of its content. The risk from using it lies entirely with the user. While using this site, you agree to have read and accepted our terms of use and privacy policy.
Copyright © 2009 JSPSERVLETTUTORIAL.INFO All Right Reserved