Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
The interface is intended for declaring an external API without specifying the implementation. It should only have public members.
Generally speaking, this is an artificial limitation adopted for convenience. In the same C++, purely virtual (abstract) stateless classes are used as interfaces. The presence of a special syntactic construction (interfaces, as in C# or Java) makes it possible to clearly emphasize that there is no surprise for the programmer and this type is used as a "glue" between other classes.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question