19. The three characteristics of object-oriented inheritance polymorphism encapsulation

Three characteristics encapsulation, inheritance, polymorphism, then if the count is four encapsulation, inheritance, polymorphism, abstract

 

1. Packaging

The repeated code is written to a method of packaging

Avatar --- methods, classes, property privatization. . .

The property privatization, two public methods and access attributes set to make the value of the property, can improve the security code (an error of judgment and negative data).

The get and set methods can be generated by right-clicking shortcut - sourse-gets () or sets ();

Guess you like

Origin www.cnblogs.com/xuwangqi/p/11082731.html