- Only
abstractclasses can haveabstractmembers. - A non-
abstractclass that inherits from anabstractclass mustoverrideitsabstractmembers. - An
abstractmember is implicitlyvirtual. - An
abstractmember cannot provide any implementation (abstractis calledpure virtualin some languages). - An
abstractclass cannot be instantiated
The answer is 'implicitly, yes, explicitly, no' - confusing answer, yes? Point 3 above explains it. Any 'abstract' method is, in fact, 'virtual' in that it can be implemented by a deriving class - and in fact, if it is declared 'abstract', it MUST be implemented by a deriving class.
In the case of an Interface:
- No Interface members can provide any implementation
- An implementing class (note that Interfaces are 'implemented', not 'inherited' from) must implement all members of the Interface
No comments:
Post a Comment