1. An abstract class may contain code in method bodies, which is not allowed in an interface.
2. abstract class are used only when there is a "IS-A" type of relationship between the classes. Interface can be implemented by classes that are not related to one another and there is "HAS-A" relationship.
3. You cannot extend more than one abstract class. You can implement more than one interface.
4. Abstract class can implemented some methods also. Interfaces can not implement methods
2. abstract class are used only when there is a "IS-A" type of relationship between the classes. Interface can be implemented by classes that are not related to one another and there is "HAS-A" relationship.
3. You cannot extend more than one abstract class. You can implement more than one interface.
4. Abstract class can implemented some methods also. Interfaces can not implement methods
No comments:
Post a Comment