A New Internet Library: Add Your Website/Blog or Suggest A Website/Blog to our Free Web Directory http://anil.myfunda.net.

Its very simple, free and SEO Friendly.
Submit Now....

Thursday, June 26, 2008

Different class and member Access modifiers / modifiers in C# and VB.NET?


























































C#


VB


Class cannot be inherited (cannot be a base class).


Sealed


NotInheritable


Class cannot be instantiated but only used as based
class and/or with abstract methods.


Abstract


MustInherit


For class members: member is accessible only from the
class in which it is declared. For classes: only allowed on nested classes
to restrict access to the nested class to the containing class..


Private


Private


For class members: member is accessible only from types
defined in the same assembly. For classes: class is accessible only from
types in the same assembly.


Internal


Friend


For members: member is accessible from the class in
which it is declared and from any class derived from that class.


Protected


Protected


Combines the access of Protected and Internal for a
class member


Protected Internal


Protected Friend


Access is not restricted.


Public


Public


Hides a member inherited from a base class.


New


Shadows


No comments:

Post a Comment

Post your comments here:

Dotnet-Interviews