How do you create a pure virtual function in c#?

Questions by musclebai   answers by musclebai

Showing Answers 1 - 18 of 18 Answers

The virtual function is used to allow the subclasses to provide implementation for that  method using the keyword override.

class  base1
{
public void A()
{
Console.WriteLine("base1.A is called");
}
public virtual void virt()
{
Console.WriteLine("base1.virt is called");
}
}

  Was this answer useful?  Yes

asaf122

  • Jan 28th, 2010
 

As I know pure virtual doesn't exist in C# (it's C++ concept)
If you are using abstract class you cannot make instance of this class but you can implement functions.

  Was this answer useful?  Yes

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