Encapsulation means the aggregation of data and behavior. : Encapsulation « Object Oriented « SCJP






public class MainClass {
  public static void main(String[] argv) {
    System.out.println();
  }
}

class Window {
  private int width = 0;

  private int height = 0;

  public void setSize(int w, int h) {
    this.width = w;
    this.height = h;
  }

}








6.1.Encapsulation
6.1.1.Encapsulation means the aggregation of data and behavior.