Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is a C# field private by default? [duplicate]

Tags:

c#

Possible Duplicate:
Default visibility for C# classes and members (fields, methods, etc)?

Is a C# field by default private? In general is there a guide (possibly a msdn guide) that specifies these things? When you ommit a modifier, which one is used? Thanks indeed.

like image 785
Sunscreen Avatar asked Dec 27 '22 20:12

Sunscreen


2 Answers

Yes, it is private by default. More discussion around it in this and this question.

like image 166
Peter Lillevold Avatar answered Jan 08 '23 02:01

Peter Lillevold


All type members are private by default.

like image 43
leppie Avatar answered Jan 08 '23 02:01

leppie