Question
How to use array in java?
Answer
This code uses a hash map to store the associative array, by calling the constructor of the HashMap class; however, since the code only uses methods common to the interface Map, one could also use a self-balancing binary tree by calling the constructor of the TreeMap class (which implements the subinterface SortedMap, without changing the definition of the phone_book variable or the rest of the code, or use a number of other underlying data structures that implement the Map interface.
— Source: Wikipedia (www.wikipedia.org)