Answers

Question and Answer:

  Home  Senior .Net Developer

⟩ Explain me what is encapsulation?

Encapsulation is one of four basic features of OOP and refers to the inclusion within a program object of methods and data needed for the object to function. For .NET interview questions like this, candidates should mention that encapsulation helps keep data from unwanted access through binding code and data in an object, which is the basic, single self-contained unit of a system.

Another way of understanding encapsulation is to think of it as “hiding” the state of an object as private or protected. Under this principle of information hiding, the internal workings of an object are segregated from the rest of the application. This is useful because it makes it less likely that other objects can modify the state or behavior of the object in question.

 120 views

More Questions for you: