Menu ▼


Access specifiers(or access modifiers) are used to set the accessibility of classes, methods and variables.

Types of modifiers
  • Public
  • Private
  • Protected
  • Internal
  • Protected Internal

Public
Can be accessible outside the class (anywhere) in the same assembly or another assembly.

Private
Accessible only in the same class.

Protected
Accessible in the same class or in a derived class of that class.

Internal
Accessible anywhere in the code with in the assembly. But not accessible in another assembly.

Protected Internal
Accessible anywhere in the code with in the assembly. And accessible only in derived class in another assembly.

Read More...
Submited By : mrkraju On 04 Nov 2015
Abstract Method:
  1. If abstract method is defined in a class, then the class should declare as abstract class.
  2. Abstract method should contain only method definition, should not contain the method body / implementation.
  3. Abstract method must be over ride in the derived class.
Virtual Method:
  1. Virtual methods can be over ride in the derived class but not mandatory.
  2. Virtual methods must have the method body / implementation along with definition.

Example :



Read More...
Submited By : mrkraju On 03 Feb 2014




Search dotnetlearners.com