Atulya Panda
Is it possible to override private virtual methods?
Posted by Atulya Panda in C# Programming on Nov 26, 2012
  • 1
  • 10
  • 7934
Do you know the answer for this question? Post it below.
Posted by raj kadam on Feb 23, 2015
  • 2

no,you can not override the private virtual method
bcoz virtual method cannot be private!!!

Posted by Anupam Singh on May 13, 2014
  • 1

Hi Atulya,
Private virtual methods cannot be declared in the C# language. So no question comes to override i think.Seems interviewer was tweaking you :).

Posted by Neeraj Negi on May 01, 2014
  • 1

as it is not possible to inherit private methods from parent class you cant override it.

Posted by Mitesh Patel on Aug 09, 2015
  • 0

there is not allow to write virtual method as private so there is no question for override private virtual method

Posted by Ashvani chaudhary on Jul 03, 2015
  • 0

Hello Atulya
As we know that the virtual method is designed to use in derived class by override concept in c# . We can declare virtual method private but at the compile time it through error (Virtual method cant be private). Even C# basic concept is private member cant be accessed outside the call regardless of by property. So finally its clear we cant declare virtual method as private and cant override it in derived class

Posted by Prasenjit Dey on Aug 05, 2013
  • 0

No. It cannot inherited from other class due to private keyword

Posted by JAGAN reddy on Apr 21, 2013
  • 0

no u cant

Posted by keerthi rakasi on Feb 28, 2013
  • 0

No.And also the default access specifier in abstract methods is public.

Posted by Nehal Thakkar on Dec 02, 2012
  • 0


Posted by Nehal Thakkar on Dec 02, 2012
  • 0

No, moreover, you cannot access private methods in inherited classes, have to be protected in the base class to allow any sort of access.