none
main difference between virtual and abstract method

Answers

  • Hi,

    an abstract method has no implementation and a subclass has to implement it (if it is not an abstract class) but a virtual method has an implementation and a subclass does not have to implement it again (but can replace the original implementation).

    With kind regards,

    Konrad

    • Proposed as answer by RohitArora Tuesday, December 27, 2011 11:39 AM
    • Marked as answer by Paul Zhou Wednesday, January 04, 2012 6:57 AM
    Tuesday, December 27, 2011 10:35 AM

All replies

  • Hi,

    an abstract method has no implementation and a subclass has to implement it (if it is not an abstract class) but a virtual method has an implementation and a subclass does not have to implement it again (but can replace the original implementation).

    With kind regards,

    Konrad

    • Proposed as answer by RohitArora Tuesday, December 27, 2011 11:39 AM
    • Marked as answer by Paul Zhou Wednesday, January 04, 2012 6:57 AM
    Tuesday, December 27, 2011 10:35 AM
  • an abstract method has no implementation and a subclass has to implement it (if it is not an abstract class) but a virtual method has an implementation and a subclass does not have to implement it again (but can replace the original implementation).


    Konrad has explained it pretty well. Just want to add one thing here :

    A virtual method has to be overridden in sub class using keyword "override".

    Hope this helps!


    Every day its a new learning. Keep Learning!!
    If this post answers your question, please click Mark As Answer . If this post is helpful please click Mark as Helpful
    Tuesday, December 27, 2011 11:25 AM

  • Hi Konrad,

    Thank you very much

    Thanks,

    Wednesday, December 28, 2011 7:53 AM
  • 1 more difference is...

    Abstract methods can reside in Abstract Class only. you cannot put abstract method in concrete class.

    Wednesday, December 04, 2013 5:29 AM