why overriding in the following situation?
suppose i have like this
class a
{
public virtual int add(int x ,int y)
{
retunt x+y;
}
}
class a:b
{
public Override int add(int x ,int y)
{
/// some logic here
}
}
in the above situation i can get the child and parent add() method by creating object on them then why i go for Overriding ?
is there is any performance issues are there ?like memory allocation...etc?
Plz help me ...........