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

Does isempty check for null?

953


How do you print array in java?

918


Why main function is static?

1141


What is api data?

944


What is derived datatype?

1145


Is java programming easy?

934


What is the purpose of the finally clause of a try-catch-finally statement in java programming?

888


when to use ArrayList and when to use HashMap in webApplication.

4585


What is the purpose of garbage collection in java?

1042


What is a void method?

875


Does string is thread-safe in java?

1018


What does isempty () do in java?

996


How are the elements of a gridbaglayout organized?

988


Is 64bit faster than 32 bit?

1011


If two threads have same priority which thread will be executed first ?

1410