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 connected and diconnected database ?
What's the problem with .net generics?
How inheritance works in .net?
Please explain what is the .net framework and how does it work?
If we write any code for DataGrid methods, what is the access specifier used for that methods in the code behind file and why?
What is common language specification (cls)?
Difference between dispose and finallize method?
How to customize the trace output?
How to implement datagrid in.net? How would you make a combo-box appear in one column of a datagrid? What are the ways to show data grid inside a data grid for a master details type of tables? If we write any code for datagrid methods. What is the access specifier used for that methods in the code behind file and why?
What is the difference between imperative and interrogative code?
What is the difference between user control an custom control? Advantages/disadvantages?
What is a serviced component?
explain the states of a window service application?
Is .net capable of supporting multi-thread?
Is Driver Script any how related to AOM?