Can u explain me What is encapsulation?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / shubh
Encapsulation:-
"Encapsulation means data binding and hiding."
In encapsulation we hide the data for security purpose.
For example- The car is one of the good example of
encapsulation. We applied the break to stop the car but
internally we don't know how the process will work.
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / megha
Details are what a 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 |
Answer / 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 |
Answer / imatoria
Encapsulation means hiding the complexity of the object from
outer world. Hiding (wrapping) could be done with class
keyword. So, person creating the object of this class
doesn't know how this class is manufactured, but only public
variables/properties/functions etc.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is exception handling?
Will it go to finally block if there is no exception happened?
How will you make .NET programs work in Linux ?
How to load a user control dynamically in runtime?
Explain what is heap and what is stack?
Explain difference between panel and groupbox classes using .net?
Difference between user groups and code groups
What is SOAP? How you will do windows and forms authentication?
i had attended to infosys interview on 17th april 2010...on .net..3+ experience for Technology Analyst .. to my knowledge i did well in technical and hr whether i loose the interview or still processing is taking place..am confused please. what accuatly would be happend?
What are data types in .NET?
I am constantly writing the drawing procedures with system.drawing.graphics, but having to use the try and dispose blocks is too time-consuming with graphicsobjects. Can I automate this?
What are the different types of remote object creation mode in .net?