Can u explain me What is encapsulation?

Answer Posted / megha

Details of what a class contains is not visible to other
classes.Instead only specific information is made visible.
ATM center is one real world example.
Encapsulation is achieved with the help of properties.
ex:-
int _empno;
public int EmpNo
{
get
{
return _empno;
}
set
{
_empno=value;
}
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to produce an assembly?

853


What is loosely coupled solution in.net?

791


How do you trigger the paint event in system.drawing?

787


Explain about Behavioral design pattern?

870


What is close method? How its different from finalize and dispose?

783


What is garbage collection in .net? Explain the garbage collection process?

798


Explain what is a manifest in .net?

815


Can any object be stored in a viewstate in .net?

831


What are .net functions?

749


What are the deferred execution and the immediate execution in linq?

800


Explain cas (code access security)?

825


How server form post-back works?

843


What are the different.net tools which you used in projects?

771


Is it true that objects don't always get destroyed immediately when the last reference goes away?

801


What's wrong with a line like this? Datetime.parse(mystring);

784