Can u explain me What is encapsulation?

Answer Posted / manikanta.srinu

Wraping(Binding) of data in a single unit.
Encapsulation is combines one or more information into a
component.
* You hide the data for security such as making the
variables as private, and expose the property to access the
private data which would be public.
So, when you access the property you can validate the
data and set it.
Eg 1: Capsule is mixed with one or more medicine and packed
into the tube. so its related and acting in two moducles.
EX:public class Demo
{
private int _mark;

public int Mark
{
get { return _mark; }
set { if (_mark > 0) _mark = value; else _mark = 0; }
}
}

Is This Answer Correct ?    12 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what are possible implementations of distributed applications in .net?

538


Tell us what is json data, and what is one way that .net developers can work with json?

569


Explain attributes in dot net?

571


What is the use of Treeview control?

616


What data providers available in .net to connect to database?

522






Explain about the Common Language Runtime?

620


What is 3 tier architecture?

580


Explain the difference between asp.net & vb.net and explain architecture?

544


Please explain what is heap and what is stack?

575


Which file is taken by compiler when we have both file Application and Server Configuration file?

1561


What is immutability?

571


What are the new 2.0 features useful for?

637


How to produce an assembly?

566


How to convert a .NET object into COM operabililty?

578


What is .net and .net framework?

621