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
What is the best way to crack the certification?
How to manage pagination in a page using .net?
What is meant by globalization?
What class does icon derive from? Isn't it just a bitmap with a wrapper name around it?
What is .net and .net framework?
object is physical and class is logical..here class is not occupying any memory as our definition of class but i got a question then the class where it stores if it is not occupying any memory....
What is meant by managed and unmanaged code?
What is a serviced component?
What is "common language specification" (cls) in .net?
What is finalize method in .net?
What is singleton activation mode in .net?
Is there a way to suppress the finalize process inside the garbage collector forcibly in .net?
What is RCW (Run time Callable Wrappers)?
Explain what is the difference between a class and an object?
What is data type and how many types of data types are in .NET ?