Santosh Kumar  Kotnala
what is diffreence between abstract and virtual method in csharp ?
By Santosh Kumar Kotnala in ASP.NET on Jan 21 2011
  • Abhishek Bhat
    Jan, 2011 27

    Abstract method - Abstract class can have this. These methods have to be implemented in the derived class. Abstract method will not have implementation.


    Virtual method - Will have implementation and the base class can override using override keyword if needed.

    • 0
  • knights
    Jan, 2011 24
  • Fawad Mirza
    Jan, 2011 23

    dear abstract is a complete class and virtual is a part of overriding in c#
    details
    abstract method:
              its an empty class it show the definitions of the method which u r using in class and it also has its own methods and variables
    virtual method:
    actually when we make same methods with same name and with same return type and with same parameters in differnt classs when we use virtual and override concept in class
    example:
    class A
    {
    void virtual abc(sting a)
    {

    }
    }
    Class B:A
    {
    void override abc(string a)
    {

    }
    }

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS