Introduction to java programming ideas (a) objects

1.1 abstraction

  1. Object-oriented Smalltalk, five basic characteristics
    ① All is subject.
    ② program is a collection of objects, they have to do to inform each other by sending messages.
    ③ Each object has its own constituted by other stored objects. (May include by way of an existing object package to create new types of objects.)
    ④ Each object has its type.
    All the objects of a particular type ⑤ may receive the same message.

Each object has an interface 1.2

  1. Describes a class with the same characteristics (data elements) and the object behavior (function) is set, it is actually a class of data types.
  2. One of the challenges of object-oriented programming is to create a one to one mapping between objects and solution space of the elements of the problem space
  3. Interface: determined for a particular object request can be issued (To achieve the function).
    Implementation: meet these requests the code in the program and data together constitute a hidden achieved.

1.4 hidden concrete realization

  1. Reason for the existence of the access control
    1 so that the client programmer can not touch the part (implementation of) they should not reach
    2 to allow the library designer to change the internal class work without affecting the client programmer

1.6 Inheritance

  1. It is-a (a) the relationship: can completely replace a group derived class object with a class object, which may be considered as purely an alternative embodiment of the circular geometry.
  2. is-like-a (like a): In the derived class to add a new interface elements, so it extends the interfaces Example: scientific calculators like a simple timer,
Released five original articles · won praise 0 · Views 98

Guess you like

Origin blog.csdn.net/weixin_41246909/article/details/104282059