For example, in the java tutorials (https://docs.oracle.com/javase/tutorial/java/IandI/abstract.html), the AbstractMap class is used as an example for an abstract class. Since jdk8, where interface methods can now be default or static, is there any reason (other than the fact that it's already there and previously made sense) that AbstractMap couldn't have been an interface? As far as I understand, the remaining differences post jdk8 are:
- An abstract class can be used to abstract state (not constrained to static final fields/ and have can have constructors) where an interface can not.
- Multiple interfaces can be implemented (by related or unrelated classes) while only one class can be extended.
- The added functionality to interface was to preserve backwards compatibility.
It looks like if done from scratch, an interface would have provided largely the same functionality in most cases, and deciding on which to use boils down to points 1 and 2 regardless of 3 being the reason for the expanded interface functionality.
Is there anything I'm missing? Are there any examples of standard library classes made at or post jdk8 that exemplify these differences? I'm learning so please forgive me if I've overlooked something.