C# and VB.NET: Tricky Things on Access Modifiers

Published 08-11-2006 5:57 PM | mitsram
Access modifiers allows you to control how the elements of your application are accessed. Access modifiers are keywords such as Public, Private, Protected, Friend, and Protected Friend in VB.NET (public, private, protected, internal, protected internal in C#).

For member variables with no access modifiers used:
  - Private in VB.NET and C# classess.
  - Public in VB.NET structures.
  - Private in C# structures.

Although methods does not require an access modifiers, you should be aware of its scope if it's not specified:
  - Private by default in a class or structure in C#.
  - Public in a class or structure in VB.NET.

Filed under: ,

Comments

# jokiz said on August 13, 2006 9:48 PM:

you forgot about the trivial modifier for classes and structures, see my post here (http://community.devpinoy.org/blogs/joeycalisay/archive/2005/09/30/Default-modifier-in-.NET.aspx)