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?
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.