1.

How will you implement Encapsulation?

Answer»

Encapsulation is done with the help of access modifiers in C#: public, private, protected, and default.

Scope of an element with the access specifier / Access specifierspublicprotectedinternalprotected internalprivateprivate protected
Entire programYesNoNoNoNoNo
Containing classYesYesYesYesYesYes
Current assemblyYesNoYesYesNoNo
Derived typesYesYesNoYesNoNo
Derived types within the current assemblyYesYesYesYesNoYes



Discussion

No Comment Found