One major difference is that you don’t have to implement all the methods in the abstract classes, unless all the methods are declared abstract.
In an interface all the methods are abstract hence they would have to be implemented in the class that implements the interface. Also there can be no variables and method bodies where as in an abstract class you can have methods with method bodies(implementation)
No comments:
Post a Comment