What is Encapsulation? - .NET

What is Encapsulation?

Encapsulation is the wrapping of data and code acting on data together in a single unit (class). The data is hidden from other class and can be accessed only through the methods of their current class. This way a class has total control over what is stored in its fields.

Example

public class Student {
  private String name; // any class that wants to access the variables should access them through getName and setName methods

  public String getName() {
    return name;
  }
  public void setName(String newName) {
    name = newName;
  }
}
Session state management options available with ASP.NET
ASP.NET - Session state management options available with ASP.NET - ASP.NET provides In-Process and Out-of-Process state management..
Methods fired during the page load - ASP.NET
ASP.NET Methods fired during the page load - Init() - when the page is instantiated....
Concept, capabilities and features ADO.NET
Concept, capabilities and features ADO.NET - It is data-access technology, primarily disconnected and designed to provide efficient....
Post your comment