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

What is an i/o filter?

1983


What does the @override annotation do?

1097


What are the disadvantages of object oriented programming?

1347


How many bytes is a unicode character?

1063


What is the concatenation operator in java?

1213


What's the access scope of protected access specifier?

1103


What is difference between float and double?

1017


what is mutual exclusion? : Java thread

1075


What is wrapper class example?

1051


what are three ways in which a thread can enter the waiting state? : Java thread

1076


Can an interface implement another interface?

1094


What is a classloader in java?

1068


What is parsing in java?

1017


What are the approaches that you will follow for making a program very efficient?

1132


How to display arraylist values in java?

1072