Virtual method - Will have implementation and the base class can override using override keyword if needed.
Interviews3 answers
what is diffreence between abstract and virtual method in csharp ?
3 Answers
Abstract method - Abstract class can have this. These methods have to be implemented in the derived class. Abstract method will not have implementation.
Abhishek BhatPosted Jan 27, 2011, 2:31 AM EST
Please check the following for a complete overview
knightsPosted Jan 24, 2011, 11:52 AM EST
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)
{
}
}
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)
{
}
}
Fawad MirzaPosted Jan 23, 2011, 8:03 AM EST


