What’s Dynamic Keyword Insertion, And How Should I Use It?

Whats the use of virtual keyword in c#?

  • e.g: public virtual void ClearLastException() { LastException = null; }

  • Answer:

    When you create a child class of the class which contains the virtual method you will be able to override the method which has the virtual keyword. in your example you have a method 'clearLastException'. If i was to create a class which is a child class of the parent class which contains 'clearLastException' i would be able to override this method. msdn explanation: http://msdn2.microsoft.com/en-us/library/9fkccyh4.aspx wikipaedia explanation of inheritance: http://en.wikipedia.org/wiki/Inheritance_%28computer_science%29

Atty at Yahoo! Answers Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.