The code snippet below makes me puzzled:
HashMap<String, String> m = new HashMap<>();
Map m1 = new HashMap<>();
System.out.println("m instanceof Map: "+(m instanceof Date)); //First
System.out.println("m1 instanceof Map: "+(m1 instanceof Date)); //Second
First gives a compilation error while the Second doesn't. Why? Can anyone help me explaining this, pls?