Access Modifiers are used to control what our class objects can access its own fields or methods if they are created in some other classes
public fields or methods is accessible from all classes every where
Private:
Private fields or methods is accessible only with in its own class
Internal:
Internal fields or methods is accessible from all classes defined in the same assembly
Protected:
Protected fields or methods can be accessed by its objects with in the same class or derived classes
Protected Internal:
Protected fields or methods can be accessed by its objects in all classes with in the same assembly or by derived classes from other assembly
- Public
- Private
- Internal
- Protected
- Protected Internal
public fields or methods is accessible from all classes every where
Private:
Private fields or methods is accessible only with in its own class
Internal:
Internal fields or methods is accessible from all classes defined in the same assembly
Protected:
Protected fields or methods can be accessed by its objects with in the same class or derived classes
Protected Internal:
Protected fields or methods can be accessed by its objects in all classes with in the same assembly or by derived classes from other assembly





No comments:
Post a Comment