java4all@1986 java. Powered by Blogger.

To get duplicate key we use Identity HashMap with Example?

>> Tuesday, May 24, 2011

To identify duplicate keys in Identity HasMap JVM uses (==).

PROGRAM:
                  class DuplcateKeys{
                    IdentityHashMap ihm=new IdentityHashMap();
                   ihm.put("10", "BHaskar");
                   ihm.put("10","Ajantha");
                    System.out.println(ihm);
                              }
OUTPUT:
          {10 : Bhaskar,  10:Ajantha}

0 comments:

Post a Comment

FaceBook Login

HTML/JAVASCRIPT

HTML/JAVASCRIPT

HTML/JAVASCRIPT

HTML/JAVASCRIPT

Total Pageviews

STATCOUNTER

  © Blogger template Simple n' Sweet by Ourblogtemplates.com 2009

Back to TOP