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
Explain about .net?
What is Finalizer in .NET define Dispose and Finalize ?
What are .net functions?
Please explain what are an inheritance, polymorphism, and encapsulation?
What is the use of immutability?
hai, about trading domain and need simple project on trading system. please help me...
What are the new 2.0 features useful for?
What is garbage collection and how it works. Provide a code example of how you can enforce garbage collection in .net?
Explain about .NET services?
Is .net core stable?
What is the procedure to add assemly to gac to make it shared one?
What is singleton activation mode in .net?
Show different types of collection in .NET?
Explain soap and xml?
What does .net stand for?