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 / haneef

see, there is no add() in the Map, so u will get compilation
error.

there is only put();

Is This Answer Correct ?    22 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is the difference between thread and runnable types? : Java thread

551


Where are variables stored?

555


How to perform selection sort in java?

588


explain the concept of virtual method invocation in polymorphism in detail?

1720


What do you mean by checked exceptions?

541






Can classes declared using the abstract keyword cab be instantiated?

563


What is definition and declaration?

530


What do you mean by constructor?

552


How do you remove spaces in java?

541


What does localhost mean?

502


What's the difference between an abstract class and interface in java?

562


What is nextline method in java?

566


How many bits is a word?

570


What is early binding and late binding in java?

595


How many types of voids are there?

539