Encapsulation
This rule/property is the easiest to understand among the four. This property dictates that all objects should be capsules and that all data related to an object should be inside that object.

The code below does not follow the rule of encapsulation. An object cannot access a property if the property is outside itself (i.e., outside the capsule). Thus, this code will not even compile since encapsulation says that all objects and methods in Java must be within an object.
1// This is wrong, shapeMaxWidth is external to the class
2var shapeMaxWidth = 0;
3class Shape {
4 constructor(maxHeight) {
5 this.maxHeight = maxHeight;
6 }
7
8 getMaxArea() {
9 return this.shapeWidth*this.height;
10 }
11}