how do you store phone numbers using java collections

Answer Posted / rajeev

Hash map is only the answer to solve this type of problem....
HashMap hs=new HashMap();
hs.lateral={"Ankit Arora","9897655434"};


like this we can store the number using hash map table.

Is This Answer Correct ?    0 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you sort in descending order in java using collections sort?

492


How can we make copy of a java object?

544


What is tochararray in java?

496


What do you understand by overloading and overriding in java?

544


Name few java 8 annotations ?

561






What is the difference between form & report?

588


Difference between arraylist and hashset in java?

539


How can we make string upper case or lower case?

595


What is a 16 bit word?

561


Which list is sorted in java?

580


What is null statement?

528


Why do we declare a class static?

541


List some oops concepts in java?

578


Can we serialize arraylist in java?

538


How many threads can java run?

554