Understanding Access modifiers in OOPs

Posted by : Rakesh Sinha
Posted On : 8/26/2016 12:39:21 PM
Posted As :Question Answers
Category :Software Development
View : 398
                 protected:
The type or member can be accessed only by code in the same class or struct, or in a class that is derived from that class.

internal:
The type or member can be accessed by any code in the same assembly, but not from another assembly.

protected internal:
The type or member can be accessed by any code in the assembly in which it is declared, or from within a derived class in another assembly. Access from another assembly must take place within a class declaration that derives from the class in which the protected internal element is declared, and it must take place through an instance of the derived class type.

private:
The type or member can be accessed only by code in the same class or struct.

public:
The type or member can be accessed by any other code in the same assembly or another assembly that references it.
 
what is Data Binding?
Submitted in: Ask Question | Category: Software Development
how to pass data from one activity to another activity?
Submitted in: Ask Question | Category: Software Development
What is Data Annotations ?
Submitted in: Ask Question | Category: Software Development
What is difference between $Scope and $rootScope ?
Submitted in: Ask Question | Category: Software Development
What is difference between TextBox and TextBoxFor?
Submitted in: Ask Question | Category: Software Development
how to send selected data to another page on button click
Submitted in: Ask Question | Category: Software Development
what is attribute routing in asp.net mvc
Submitted in: Ask Question | Category: Software Development
What’s an Object ?
Submitted in: Ask Question | Category: Software Development
What is the Android Architecture?
Submitted in: Ask Question | Category: Software Development
What is difference between account payable and bills payable?
Submitted in: Ask Question | Category: Accounting
What is the diff. between abstract class & interface
Submitted in: Ask Question | Category: Software Developement

All rights reserved to Interviewfunda.com. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. While using this site, you agree to have read and accepted our terms of use and privacy policy. Best viewed at 1024 x 768 resolution with Internet Explorer 5.0 or Mozila Firefox 3.5 or Google Crome and higher