0
So the only difference between interface and an abstract class is that you can't encapsulate them and can't use properties in them?
2 ответов
+ 8
There are technical differences between Abstract Classes and Interfaces, that being an Abstract Class can contain implementation of methods, fields, constructors, etc, while an Interface only contains method and property prototypes. A class can implement multiple interfaces, but it can only inherit one class (abstract or otherwise).
Basically, an Interface defines what something can do (how it behaves), and an Abstract Class defines what something is.
0
abstract is a class
but interface is not a class