When to use Interface: If your child classes should implement a certain group of methods/functionalities but each of the child classes is free to provide its own implementation then use interfaces.
When to use Abstract Class: When you have a requirement where your base class should provide default implementation of certain methods whereas other methods should be open to being overridden by child classes use abstract classes
0
comments:
Post a Comment
Note: only a member of this blog may post a comment.
If your child classes should implement a certain group of methods/functionalities but each of the child classes is free to provide its own implementation then use interfaces.
When to use Abstract Class:
When you have a requirement where your base class should provide default implementation of certain methods whereas other methods should be open to being overridden by child classes use abstract classes