icon-cookie
The website uses cookies to optimize your user experience. Using this website grants us the permission to collect certain information essential to the provision of our services to you, but you may change the cookie settings within your browser any time you wish. Learn more
I agree
Summary | 4 Annotations
interfaces cannot store state. They can have properties but these need to be abstract or to provide accessor implementations.
2017/09/17 12:42
Properties declared in interfaces can't have backing fields, and therefore accessors declared in interfaces can't reference them.
2017/09/17 12:43
. A property declared in an interface can either be abstract, or it can provide implementations for accessors.
2017/09/17 12:44
However, if we derive D from A and B, we need to implement all the methods which we have inherited from multiple interfaces, and to specify how exactly D should implement them. This rule applies both to methods for which we've inherited a single implementation (bar()) and multiple implementations (foo()).
2017/09/17 12:49