is it possible to add a object in a HASHMAP

Answer Posted / janardhan

yes we can add object in Hashmap

example:--

ArrayList l=new ArrayList();
l.add(10);

HashMap map=new HashMap();
map.put(l,"13");

here l is object

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is string thread safe in java?

587


What is identifier give example?

563


Why scanner is used in java?

554


What is the function of static in java?

547


Is 64bit faster than 32 bit?

584






Why java is object oriented?

592


What is the difference between procedural and object-oriented programs?

530


What is the purpose of the enableevents() method in java programming?

597


Are arrays immutable in java?

551


what is encapsulation in java? Explain

669


Explain the difference between the public, private, final, protected, and default modifiers?

557


What is an off by one error in java?

509


Explain creating threads by extending thread class ?

582


How many types of literals are there in JAVA?

596


What is a void in java?

586