Skip to main content
Abstract Class and Interface
What is the difference between abstract class and interface?
Abstract Class-
- Abstract classes can have implementation for some of its members.
- Abstract classes can have fields as its members.
- Abstract class can inherit from another abstract class or interface.
- Multiple inheritance is not possible in case of abstract class.
Interfaces-
- Interfaces cannot have implementation for any of its members.
- Interfaces cannot have fields as its members.
- Interface can only inherit from another interface and not a class.
- Multiple inheritance is possible in case of interfaces.
Comments
Post a Comment