Difference between Interface and Abstract Class?
Page 1 of 1
Difference between Interface and Abstract Class?
An interface declares a set of related methods, outside of any class
An abstract class is an incomplete class definition that declares but does not define all of its methods
An interface defines an API that is independent of any class hierarchy. Interfaces are the ultimate encapsulators, but they hide all the details of the classes that implement their methods from the user of the interface.
Unlike an interface, an abstract class is a proper class. Unlike a concrete class, some of its behaviors are deliberately left to be defined by its own subclasses. Abstract classes cannot be instantiated because of this - only instances of concrete subclasses can be created.
An abstract class is an incomplete class definition that declares but does not define all of its methods
An interface defines an API that is independent of any class hierarchy. Interfaces are the ultimate encapsulators, but they hide all the details of the classes that implement their methods from the user of the interface.
Unlike an interface, an abstract class is a proper class. Unlike a concrete class, some of its behaviors are deliberately left to be defined by its own subclasses. Abstract classes cannot be instantiated because of this - only instances of concrete subclasses can be created.
Similar topics
» What does it mean that a method or class is abstract?
» What is friend class?
» What is the difference between a struct and a class?
» What methods does Class Object has?
» How can we make a class Singleton?
» What is friend class?
» What is the difference between a struct and a class?
» What methods does Class Object has?
» How can we make a class Singleton?
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum