What is he difference between two approaches of instantiating a map:
Map<String, String> map = new TreeMap<String, String>(); and
Map<String, String> map = new TreeMap<>(); and which one is better?
They are equivalent. The second syntax (known as the diamond operator) was added in Java 7 and allows you to type less code.
Map<String, Map<String, String>> map = new TreeMap<String, HashMap<String, String>>(); the assigned instance doesn't match the type of the variable. It should be Map<String, Map<String, String>> map = new TreeMap<String, Map<String, String>>();