What are the different access modifier? Explain in detail?

Answers were Sorted based on User's Feedback



What are the different access modifier? Explain in detail?..

Answer / imatoria

The access modifier on a property applies to both its get
and set accessors, so different modifiers can’t be applied
for same property.
1. Public- Accessible outside the class through object.
2. Private- Accessible inside the class by member
functions.
3. Protected- Just like private but accessible in derived
class also but by member functions.
4. Internal- Visible inside the Assembly. Accessible through
members. Logic is same as global private.
5. Protected Internal- Visible inside the assembly and
outside the assembly through derived classes.

Is This Answer Correct ?    5 Yes 0 No

What are the different access modifier? Explain in detail?..

Answer / pushparaj pentakota(anakapalli

public == accessble from any where,no restriction.
private == aceessble only from within the class only.
protected == accessble from same class and child class also
but not from non-child class.it may be within
project or out side of the project also.
internal == accessble only from same class and child class
and non-child class also but within the project
only.
protected internal == accessble from any where except
non-child class of out side of the
project.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Dot Net AllOther Interview Questions

Explain different pipelining hazards? : Dot net architecture

0 Answers  


Explain about metadata?

0 Answers  


Difference between abstract class and interface

100 Answers   Accenture, Altruist, Baba Group, CitiGroup, Fiserv, HCL, IBM, iGate, Infosys, Jean Martin, Karthik Industries, Microsoft, OnDLine, TCS,


what is the difference between value types and reference types?

4 Answers   Six Sigma,


What is CLR,MSIL and Jit Compiler and their roll in .net

1 Answers   PCS,


Define pipelining? : Dot net architecture

0 Answers  


Explain dotnet framework ?

0 Answers  


how to make and display a form without title bar?

1 Answers   Six Sigma,


What is private constructor? And it's use?

0 Answers  


Explain about httpruntime.cach.get(); method?

0 Answers   Tech Mahindra,


What are relation objects in dataset?

0 Answers  


IS IT Possible to inherit the AJAX page from child class which(child) is inherit from page class.Because i should apply some security in child class

0 Answers   IBM,


Categories