Abstract classes have the following features:
Abstract Class can’t have objects
Abstract Class may contain abstract methods and accessors
Use of sealed modifier is not allowed to prevent inheriting abstract class
Non-abstract class dervied from an abstract class must include actual implementations of all inherited abstract methods and accessors
Use abstract modifier to indicate that the method or property does not contain implementation
Abstract Methods have following features:
An abstract method is implicitly a virtual method
Abstract methods can reside only in an abstract class
Since abstract method lacks implementation, there are no braces
Implementation is provided by overriding method residing in a non-abstract class
It is an error to use static/virtual modifiers in in an abstract method
Abstract Properties have following features (similar to Abstract methods except)
It is an error to use the abstract modifier on a static property
Override modifier is used in a derived class to override abstract property
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment