rajamit872

hashCode Functions in JAVA

Aug 6th, 2014
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. //This code is to calculate the no of object created ....How one can calculate the number of object created in java program
  2.  
  3. class HashCode
  4. {
  5. public static void main(String[] args)
  6. {
  7. String s1=new String("abc");
  8. String s2=new String("abc");
  9. String s3=s1+s2;
  10.  
  11. int a;
  12.  
  13.  
  14. System.out.println(s1.hashCode());
  15. System.out.println(s2.hashCode());
  16. System.out.println(s3.hashCode());
  17. }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment