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 .net technology?
What is garbage collection and how it works. Provide a code example of how you can enforce garbage collection in .net?
What is func in .net 3.5?
What is difference between .net core and .net standard?
What is the difference between server.transfer and response.redirect? Why?
What are multicast delegates?
What is concurrency? How will you avoid concurrency when dealing with dataset?
Give a brief introduction on side-by-side execution. Can two applications, one using private assembly and the other using the shared assembly be stated as side-by-side executables?
What class does icon derive from? Isn't it just a bitmap with a wrapper name around it?
Explain what is a delegate?
What is the need of OLE-automation?
What are the types of jit?
Explain what is the difference between web application and enterprise application?
Please tell us what is the difference between override and overload in a method?
Explain what is an interface and what is an abstract class? Please, expand by examples of using both. Explain why?