how copy the hashmap object into arraylist at java program?
Answer Posted / abhinaw
HashMap hm = new HashMap();
hm.put("1", "a1");
hm.put("2", "a2");
hm.put("3", "a3");
hm.put("4", "a4");
hm.put("5", "a5");
ArrayList list = new ArrayList();
list.addAll(hm.entrySet());
System.out.println(list);
| Is This Answer Correct ? | 4 Yes | 3 No |
Post New Answer View All Answers
What is the java virtual machine?
Explain about core java?
whar are the draw backs of programming lang step by step in Clang and next in C++ and next and in Java nad in .Net
What are different ways of object creation in java ?
What are the 6 mandatory procedures for iso 9001?
What are adapter classes?
Why singleton pattern is better than creating singleton class with static instance?
What is the largest number a double can hold?
What are the limitations of procedural programming approach?
Why Set interface contains unique elements, what internally implemented for this so that it contains unique elements?
Can you extend singleton class?
How will you add panel to a frame?
Why java doesn’t support multiple inheritances?
Can an interface be defined inside a class?
What is the difference between yield() and sleep()?