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 void a data type?

729


Explain different types of wrapper classes in java?

810


What is difference between equals and hashcode method?

812


What ide should I use for java?

750


What is meant by data hiding in java?

883


Do loops java?

777


Difference between operator overloading and function overloading

854


What is difference between public static and void?

729


Define how objects are stored in java?

806


What is the differences between heap and stack memory in java? Explain

766


What is treeset in java collection?

782


Can a class have multiple constructors?

793


What language is java written?

786


What is "this" keyword in java? Explain

892


What is unmodifiable collection in java?

729