Interfaces Vs. Abstract Classes
Interfaces and abstract classes are similar. The following describes some important differences:
- An abstract class may have member variables as well as non-abstract methods or properties. An interface cannot.
- A class or abstract class can only inherit from one class or abstract class.
- A class or abstract class may implement one or more interfaces.
- An interface can only extend other interfaces.
- An abstract class may have non-public methods and properties (also abstract ones). An interface can only have public members.
- An abstract class may have constants, static methods and static members. An interface cannot.
- An abstract class may have constructors. An interface cannot.
Read more about this topic: C Sharp Syntax, Object-oriented Programming (OOP), Interfaces
Famous quotes containing the words abstract and/or classes:
“The probability of learning something unusual from a newspaper is far greater than that of experiencing it; in other words, it is in the realm of the abstract that the more important things happen in these times, and it is the unimportant that happens in real life.”
—Robert Musil (18801942)
“... too much attention is paid to dress by those who have neither the excuse of ample means nor of social claims.... The injury done by this state of things to the morals and the manners of our lower classes is incalculable.”
—Mrs. H. O. Ward (18241899)