Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Apr 30, 2012 01:25 PM|LINK
If shape class is not an abstract class so it will not have any abstract member. Basically this will be like a instantiable class. But if you think on a conceptual plane, shape class itself does not have an identity.I mean if i say draw a shape you will
instantly ask what kind of shape should i draw,is it a circle, rectangle, triange or polygon.
So shape class happen to be meaning ful when it is inherited by a concrete class like circle. So when i say draw a circle you instantly draw a circle.
So abstract classes are used to manage the complexity of real world objects.
If will be all the same if your class is not an abstract class. But to let the polymorphism work the ColorShapes() method must be virtual so that it is overridden by child classes like Circle or Triangle. The previous code will keep running.
//Override to define the exact behaviour
public virtual void ColorShapes()
Hope i could make you understand.