A review (object-oriented)

1. object features:

    (1) Object: an entity used to describe the objective reality of a composition fields and methods

    (2) field: an object having various features

    Operation (3) executing the object

2. Object-Oriented advantages:

    Information Hiding improves the maintainability and safety line of the program, consistent with the thinking habits increase the reusability of the program

 3. Objects and classes: class is abstract and concrete objects are

4. constants: Constant constant name can not be changed to JAVA using all uppercase final modification of the constants C # uses the const modifier constants

5.oop object-oriented features:

    (1) Package: hide the internal implementation, a stable external interface

    (2) Inheritance: subclass inherits the parent class, to achieve code reuse

    (3) Polymorphism: different subclasses react differently to the same message

6. The package of benefits:

    Security (1) to ensure data

    (2) provide a clear external interface

    (3) inner class changes do not affect any other classes

7. inheritance benefits:

          C # using: JAVA using sign indicates inheritance extends represent inheritance

    (1) Analog relation to reality

    (2) the structure more clearly

    (3) implementation code reuse

8. inherited characteristics:

    (1) a single root: a plurality of sub-classes can not inherit the parent class

    (2) transitivity: public subclass inherits the methods and properties of the parent class

9. overloading and rewrite the difference between:

    Overloading is the same as another method in a class name, but different argument list has nothing to do with the return value

    There must be two rewrite the inheritance, the parent class is a subclass overrides

10. Richter Substitution Principle LSP:

    Subclass object can replace all of the parent class method, the software unit of functionality is not affected, the subclass can add new behavior on the basis of the parent class  

11. The polymorphic features:

    (1) can be assigned to sub-class the parent class

    (2) the parent class as an argument subclass

12.abstract abstract:

    (1) abstract method must be written in an abstract class

    The method of the parent class (2) Subclasses must override abstract method, unless the subclass is also abstract methods abstract no method thereof

    (3) An abstract class can not be instantiated, but the abstract class has a constructor method

    (4) an abstract method can not be modified with static, it can not be sealed

     An abstract class typically represents an abstract concept, abstract method constrains the behavior of the object subclasses

13.static static

    (1) static class that is to be modified static class

      (2) do not instantiate a static class can call

      (3) is the only static class and static class loading priority

Guess you like

Origin www.cnblogs.com/HQ0422/p/11521377.html