What is the use of procedure overriding

When do we use that procedure overriding

Questions by thulasiganapathy

Showing Answers 1 - 6 of 6 Answers

Sukrath

  • Dec 22nd, 2007
 

To  supress the base class virtual method and wanted derived method to be called then Base class virtual method is overrided in the derived class.

class A

{

public virtual void func1()

{

Console.Write("Base function1");

}

}

class B : A

{

public override void func1()

{

Console.Write("Base function2");

}

}

static void Main(string[] args)

{

A a = new B();

a.func1();

}

  Was this answer useful?  Yes

So far I know. In OOPS there is nothing like Procedure Overriding. However, you have method (function) overriding. If the question is about method overriding then the answer would be:

Method overriding is used to add to or replace the functionality of the base class virtual method.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions