Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Map map = new HashMap(2);
map.add(“1”,”one”);
map.add(“2”,”two”);
map.add(“3”,”three”); What will happen at this line?

Answer Posted / raman t

if we write like this then it would be better.


HashMap map = new HashMap();
map.add( "cat", "Meow" );
map.add( "ape", "Squeak" );
map.add( "dog", "Woof" );
map.add( "bat", "Squeak" );
System.out.println( "map = " + map );

Is This Answer Correct ?    2 Yes 14 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain parallel processing in java8?

1208


How to declare objects of a class ?

1050


Which of the classes will have more memory allocated?

957


What is method overloading with type promotion?

1247


Are arrays classes in java?

1011


Write a java program to generate fibonacci series ?

1056


What are thread safe functions?

926


What is difference between length and length() method in java ?

978


what is the swingutilities.invokelater(runnable) method for? : Java thread

1028


What is jvm? How its run?

1061


Can a constructor be made final?

1087


What is object cloning in Java?

1088


What is a return in java?

1018


How will you add panel to a frame?

1092


Explain the difference between comparator and comparable in java?

925