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 are the disadvantages of indexes in oracle?
What is the java virtual machine?
What is a protected class in java?
What is stringreader?
What is the difference between array and array list in java?
What is the final variable?
Why webdriver is an interface?
Can we write class inside a class in java?
What is a boolean expression in java?
What are the types of strings?
How can we create a thread in java?
Why we override equals() method?
What is the diffrence between inner class and nested class?
What is parseint?
What is the maximum size of byte array in java?