Difference between Abstract class and Interface is as follows:-
√ Abstract class can only be inherited while interfaces can not be it has to be implemented.
√ Interface cannot implement any methods, whereas an abstract class can have implementation.
√ Class can implement many interfaces but can have only one super class.
√ Interface is not part of the class hierarchy while Abstract class comes in through inheritance.
√ Unrelated classes can implement the same interface.
√ Abstract class can only be inherited while interfaces can not be it has to be implemented.
√ Interface cannot implement any methods, whereas an abstract class can have implementation.
√ Class can implement many interfaces but can have only one super class.
√ Interface is not part of the class hierarchy while Abstract class comes in through inheritance.
√ Unrelated classes can implement the same interface.
No comments:
Post a Comment