Interfaces

Interface vs Abstract Class

Use Cases

  1. Use an interface when:
    1. You want to give some Metadata to a class describing it.
      • Serializable, Feedable.
    2. You have multiple classes in the same general category, with similar operations, but each one does it slightly differently.
    3. You want to have a subclass inherit from multiple parent classes.
  2. Use an abstract class for inheritance if: