Java interface troubles
From Java Preferences API:
Why is Preferences an abstract class rather than an interface? It was decided that the ability to add new methods in an upward compatible fashion outweighed the disadvantage that Preferences cannot be used as a "mixin".
You can't add new methods reliably to an interface? Why is that so?
Comments
Binary compatibility. If your class implements Preferences but Sun adds a new method to Preferences in 1.5, your class will fail to load until you add an implementation of that method to your class and recompile your application.
On the other hand, if Preferences is an abstract class, Sun can add new non-abstract methods without breaking applications that inherit from Preferences.
Posted by: Eric | April 21, 2003 11:39 PM
Ah... Thank you.
Posted by: Avi | April 22, 2003 10:04 AM