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
how to create multithreaded program? Explain different ways of using thread? : Java thread
What is jdbc api?
Is alive in java?
What is the difference between throw and throws keywords?
What is complexity and its types?
What is pangram in java?
What are multiple inheritances? Is it supported by java?
What is the exception hierarchy in java?
What is a constructor, constructor overloading in java?
What is the basic concepts of OOPS?
Is char a method in java?
Explain java coding standards for interfaces?
What are the access modifiers available in java?
What is the disadvantage of synchronization?
What is a get method?