I. Introduction to objects and introduction to objects
I. Five Basic Features of Java:
1. All things are objects
2. The program is a collection of objects. They send messages to each other to tell each other what to do.
3. Each object has its own storage composed of other objects
4. Each object has its type
5. All objects of a specific type can receive the same message.
2. Each object can only satisfy certain requests. These requests are defined by the interface of the object.
3. Each object provides services and regards the object as a service provider, which helps improve the cohesion of the object.
Iv. Access Control
1. Make client programmers unable to touch what they should not touch
2. Allows database designers to change their internal working methods without worrying about affecting users.
3. Four permissions: public private protected default
5. code reuse is the biggest advantage of object-oriented programming, and reference objects are the simplest reuse.
6. types not only describe the constraints acting on an object set, but also the relationship with other types.
There are two ways to make the base class and subclass different.
1. Add a new method directly
2. overwrite the original method
7. polymorphism. The process of viewing the export class as its base class is called upward Transformation (P10)
8. Java has a single inheritance structure, and all classes inherit from object classes.
9. The OOP language has its own set of containers, such as list, map, set, and components such as queues, trees, and stacks.
10. Object creation and lifecycle
1. By placing the object in the stack or static area
2. dynamically create objects in the heap memory pool
Java adopts the second method, that is, using new to create objects.