method overriding means having two or more methods with the same name in a base class and derived class but different implementation.
example class baseclass { public void show() { console.write("base method"); }
} class derived :baseclass { public void show { console.write("derived method"); } } class implement { main { derived obj=new derived() obj.show(); } }
method overriding means having two or more methods with the same name in a base class and derived class but different implementation.
ReplyDeleteexample
class baseclass
{
public void show()
{
console.write("base method");
}
}
class derived :baseclass
{
public void show
{
console.write("derived method");
}
}
class implement
{
main
{
derived obj=new derived()
obj.show();
}
}