Click here to Skip to main content
15,915,042 members
Home / Discussions / C#
   

C#

 
GeneralRe: Inherited form validation issues Pin
leppie14-Feb-04 19:57
leppie14-Feb-04 19:57 
QuestionNo private virtual methods? Pin
Nemanja Trifunovic13-Feb-04 10:04
Nemanja Trifunovic13-Feb-04 10:04 
AnswerRe: No private virtual methods? Pin
Kentamanos13-Feb-04 10:56
Kentamanos13-Feb-04 10:56 
AnswerRe: No private virtual methods? Pin
Heath Stewart13-Feb-04 12:08
protectorHeath Stewart13-Feb-04 12:08 
GeneralRe: No private virtual methods? Pin
Nemanja Trifunovic13-Feb-04 12:37
Nemanja Trifunovic13-Feb-04 12:37 
GeneralRe: No private virtual methods? Pin
Heath Stewart13-Feb-04 12:41
protectorHeath Stewart13-Feb-04 12:41 
GeneralRe: No private virtual methods? Pin
Nemanja Trifunovic13-Feb-04 12:50
Nemanja Trifunovic13-Feb-04 12:50 
GeneralRe: No private virtual methods? Pin
Heath Stewart13-Feb-04 13:00
protectorHeath Stewart13-Feb-04 13:00 
Okay, lets say for a second that C# allowed virtual on a private method. Fine.

A private method cannot be accessed (except through reflection) by neither the base class or any derivative classes. This means you can't override it because it can't even be seen by either of those classes.

And its not allowed in C# to use override on a method or property that isn't virtual.

If you read through the C# Language Specification[^] on MSDN it is mentioned (perhaps implied - it's been a long time). 3.5.1 states that privates are limited to the containing class only. The rest is mentioned in 10.2.

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: No private virtual methods? Pin
Nemanja Trifunovic13-Feb-04 14:38
Nemanja Trifunovic13-Feb-04 14:38 
GeneralRe: No private virtual methods? Pin
Heath Stewart13-Feb-04 16:57
protectorHeath Stewart13-Feb-04 16:57 
GeneralRe: No private virtual methods? Pin
Heath Stewart13-Feb-04 17:32
protectorHeath Stewart13-Feb-04 17:32 
GeneralRe: No private virtual methods? Pin
leppie13-Feb-04 19:35
leppie13-Feb-04 19:35 
GeneralRe: No private virtual methods? Pin
Heath Stewart13-Feb-04 20:00
protectorHeath Stewart13-Feb-04 20:00 
GeneralRe: No private virtual methods? Pin
leppie13-Feb-04 23:31
leppie13-Feb-04 23:31 
GeneralSending Files Pin
David_cole13-Feb-04 9:32
David_cole13-Feb-04 9:32 
GeneralRe: Sending Files Pin
Not Active13-Feb-04 9:58
mentorNot Active13-Feb-04 9:58 
GeneralRe: Sending Files Pin
David_cole13-Feb-04 22:53
David_cole13-Feb-04 22:53 
GeneralIP Retrieval Pin
David_cole13-Feb-04 9:29
David_cole13-Feb-04 9:29 
GeneralRe: IP Retrieval Pin
Kentamanos13-Feb-04 10:43
Kentamanos13-Feb-04 10:43 
GeneralRe: IP Retrieval Pin
HAHAHA_NEXT16-Feb-04 7:57
HAHAHA_NEXT16-Feb-04 7:57 
GeneralHandling Task Switching Pin
raysot77713-Feb-04 9:16
raysot77713-Feb-04 9:16 
GeneralRe: Handling Task Switching Pin
Heath Stewart13-Feb-04 12:38
protectorHeath Stewart13-Feb-04 12:38 
Generalxml in windows forms Pin
rasarit1713-Feb-04 8:43
rasarit1713-Feb-04 8:43 
GeneralRe: xml in windows forms Pin
Heath Stewart13-Feb-04 12:36
protectorHeath Stewart13-Feb-04 12:36 
GeneralItembackground Color in ListBox Pin
Snowjim13-Feb-04 8:01
Snowjim13-Feb-04 8:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.