4 ms·
Single-inheritance, but interfaces can have default implementations? Isn't that... multiple inheritance?
by sp332 15y ago
Single-inheritance, but interfaces can have default implementations? Isn't that... multiple inheritance?
- numbsafari 15y agoYou can implement multiple interfaces on a single class, but only "inherit" from a single implementation. Or, perhaps more specifically, you can implement an interface without extending its default implementation. As the article states, the default implementations are there more so that you can say "m = new Map()", instead of having to remember about this other thing called "HashMap".
- deleted 15y ago[deleted]