Jesper de Jong wrote:If lots of people have made classes that implement your interface, and you add a method to the interface, then you are forcing everybody to modify their classes - because all (non-abstract) classes that implement an interface must implement all the methods in the interface.
In an abstract class, you could add the method as a non-abstract method, which would not force all classes that extend the abstract class to implement the new method.
Saurabh Chauhn wrote:The idea to introduce the interface came with one of the OOPs concept which was missing in the Java i.e Multiple Inheritance.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Saurabh Chauhn wrote:The idea to introduce the interface came with one of the OOPs concept which was missing in the Java i.e Multiple Inheritance . As we know that Java does not support the multiple inheritance which means a class can extend only one parent class, hence Interface came into existence.
Anagha Mamtha wrote:2. Variables declared in a Java interface is by default final.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:
Anagha Mamtha wrote:2. Variables declared in a Java interface is by default final.
And static.
Consider Paul's rocket mass heater. |