There is practically no difference. In my opinion, this has always been in JDK classes (the same model exists for List and its subclasses). Designers have probably not yet removed this redundant implementation, so nothing will break if, for example, someone relies on reflection to get information about subtypes. For example, imagine that you define the following:
class MyCustomMap<K, V> extends LinkedHashMap<K, V> implements Map<K, V> { }
Then the below snippet outputs different results with and without implements :
Class<?>[] interfaces = MyCustomMap.class.getInterfaces(); for (int i = 0; i < interfaces.length; i++) { System.out.println(interfaces[i]); }
Output:
java.util.Map interface
Change of definition:
class MyCustomMap<K, V> extends LinkedHashMap<K, V> { }
then no interface will be printed.
source share