is it possible to add a object in a HASHMAP
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / ravikiran
Yes we can add Object as a value inside HashMap
Is This Answer Correct ? | 4 Yes | 0 No |
Answer / 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 |
What is the main use of generics in java?
Why do we use string?
What are the six ways to use this keyword?
What are meta-annotations?
How to use arraylist in java netbeans?
Why should we create an object? what is a need of it? Apart from access members of a class i want what is a need of object what does it contain?? In normal class to access any member of thaht class we create object where as for static class we access its members using class name. what is a difference between them... thanks in advance.
How to display names of all components in a Container?
They had given one progam final HashMap hm=new HashMap(); public void show() { hm.put("name",value); } in this prg here the final hashtable value can be changed in put method,its the prg run?
Why should we use java?
How to obtain a performance profile of java program
What is an example of a conditional statement?
What is concurrent hashmap and its features?