I noticed the following code works when compiling in eclipse with java spec 1.7 but does not work with 1.6.

HashMap<String, String> hashMap = new HashMap<>();

I'd like an explanation but this syntax and why it works for 1.7 .

Edit
Report