|
|
| | Explain Virtual Function in C#.Posted By :Ruchi Posted Date :27/02/2009 Points :10 Category :C# |
|
Virtual functions implement the concept of polymorphism are the same as in C#, except that you use the override keyword with the virtual function implementaion in the child class.
The parent class uses the same virtual keyword. Every class that overrides the virtual method will use the override keyword.
class Shape{ public virtual void Draw() { Console.WriteLine("Shape.Draw") ; } } class Rectangle : Shape{ public override void Draw() { Console.WriteLine("Rectangle.Draw"); } }
|
| | | You can also find related Interview Question to
Explain Virtual Function in C#.
below:
| |
| | Quick Links For Interview Questions Categories: | |
| Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more. |
| | | Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.
So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.
|
|