is it possible to add a object in a HASHMAP

Answer Posted / venkat

yes we can add object in Hashmap

like the example is

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

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

here list is object

Is This Answer Correct ?    15 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between array list and vector in java?

732


What is the use of private static?

783


When is the garbage collection used in Java?

886


What are different types of control structures?

722


Explain the importance of finalize() method.

757


What is super in java?

771


Explain different types of thread priorities ?

855


How arrays are stored in memory in java?

716


Is assembly language a low level language?

703


Explain hashset and its features?

829


Why use string handling in Java?

797


Define max and min heap, also the search time of heap.

821


What is serial version uid and its importance in java?

819


What is thread safe singleton?

722


What is difference between equal and == in java?

719