/ / ==================== GET accessor ========================== ============== GET Accessor is used to return a field value
CLASEE PERSON {private int number; public int number {// can write some own function get {return number;}}} When the value in the property is to be accessed, use Person P1 = New Person (); system.console.write P1.NUMBER);
/ / ===================== SET accessor ========================= =====================
The Set Accessor is used to add the value to the value of Class Person {Private String name; public string name {get {return name;} set {name = value;}}}
// Read the value in the read and write attribute Person P1 = new person (); p1.name = "Song" // Set the value in the property system.console.write (p1.name); // Read the value in the properties