Following are the notable differences between class and an interface.
Class | Interface |
---|---|
A class describes the attributes and behaviors of an object. | An interface contains behaviors that a class implements. |
A class may contain abstract methods, concrete methods. | An interface contains only abstract methods. |
Members of a class can be public, private, protected or default. | All the members of the interface are public by default. |