Hi,
I m writing code to map single key(Integer) with array of values. But, its not giving the correct output.
Here is the code:
import java.io.*;
import java.util.*;
class MapDemo{
public static void main(String args[]){
TreeMap<Integer, Object[]> tMap = new TreeMap<Integer, Object[]>();
Object[] vals = {"tree", "map", "sorted"};
tMap.put(1, vals);
System.out.println("Keys of tree map: " + tMap.keySet());
System.out.println("Values of tree map: " + tMap.values());
}
}