Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   Private Virtual Method (http://www.velocityreviews.com/forums/t544519-private-virtual-method.html)

rn5a@rediffmail.com 10-16-2007 01:14 AM

Private Virtual Method
 
Can't a method be declared as Private Virtual? If yes, then why?

Thanks,

Ron


=?Utf-8?B?TmlzaGFudCBSYW5h?= 10-16-2007 06:35 AM

RE: Private Virtual Method
 


Hi Ron,

MSDN says
The virtual keyword is used to modify a method, property, indexer or event
declaration, and allow it to be overridden in a derived clas.
You cannot use the virtual modifier with the static, abstract, private or
override modifiers.
The new class—the derived class— gains all the non-private data and behavior
of the base class in addition to any other data or behaviors it defines for
itself.

So why we would need a private virual method as it wouldn't be overridden in
the derived class because it would not have acces to it.

So exactly in which scenario do you wnat a private virtual method?

Regards,
Nishant Rana


All times are GMT. The time now is 09:28 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.