Three characteristic of object orientation: Encapsulation: capturing data and keeping it safely and security from outside interfaces 使用private关键之修饰成员变量,成员方法,被修饰的只能在本类中被使用 public class Student{ private String name; private int age; // 每个成员变量对应的有一对sett…
Object Oriented Programming python new concepts of the object oriented programming : class encapsulation inheritance polymorphism the three features of an object are : identity, state and behaviora class is an abstraction which regroup objects who ha…
Constructor : Grammar: object.constructor Example: Javascript code: 1 function obj1() { this.number = 1; } var x1 = new String("Computer"); if (x1.constructor == String) document.write("This object is a String."); var x2 = new obj1; i…