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 are classloaders?

982


what is a thread pool in java and why is it used?

955


How arrays are stored in memory in java?

952


What are the important features of Java 9 release?

965


What is the collections api in java programming?

939


Why is java so popular?

1071


What is a bubble sort in java?

912


Can a class extends itself in java?

986


How to make a write-only class in java?

1032


What is the null?

966


What is a singleton class in Java?

1004


What is the difference between preemptive scheduling and time slicing?

1026


What is the do while loop syntax?

998


What differences exist between iterator and listiterator?

1010


Can an unreferenced object be referenced again?

1153