Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //This code is to calculate the no of object created ....How one can calculate the number of object created in java program
- class HashCode
- {
- public static void main(String[] args)
- {
- String s1=new String("abc");
- String s2=new String("abc");
- String s3=s1+s2;
- int a;
- System.out.println(s1.hashCode());
- System.out.println(s2.hashCode());
- System.out.println(s3.hashCode());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment