Object Oriented (OOP) wherein

  In class the teacher more than once and we said, is a Java-based object-oriented top priority! ! So be sure to solid basic skills, the code is fool alive, it's important thinking!

  In general oop three characteristics are: encapsulation, inheritance and polymorphism, the last time I saw also classed among the abstract, you can not buy any.

  Package:

    Usage: modifier is private and get, set method, it can be automatically generated using the shortcut key idea, eclipse and other software, add control statements by demand in get, set method in.

  The goal is to package high cohesion, to achieve low coupling software components, programs prevent the influence of fluctuation caused by interdependence. Object is the basic unit of package, in a class, the property is defined as private variables, behavior method definition, only the class can access their own way to these private variables, which basically achieve the object of the package.

 

  Inheritance (extends):

    In the definition and implementation of a class, you can base an existing class come in, put the contents of existing classes defined as its content-and can be-added several new content, or modify the original way to make the more appropriate special needs, which is inherited. Inheritance is a mechanism and methods of the parent class data subclasses automatic sharing, which is a relationship between the classes, increases the reusability and extensibility as software.

  Polymorphism: references to the parent class subclass object

    Polymorphism means that a particular reference variable type defined in the program pointed to by the reference variables and the method call issued when programming is not determined, but is determined only during the program run, i.e. a reference variable which points to the class in the end examples of objects that reference variable method calls made which class method is implemented, it is necessary to decide the program is running, so that you can select multiple programs running, which is polymorphic.

  abstract

    It is to find some similarities and common place things, and these things will be classified as a class (abstract abstract classes and interfaces interface)

Guess you like

Origin www.cnblogs.com/roc-cy/p/12075553.html