1. Abstract process
Q: What is an object???
A:1) Everything is Object---object has state, behavior, and identity
2) programs are collections of objects that they tell each other to do by sending messages
3) Create a new type of object by creating a package that contains existing objects
4) Each object has its type.
Each object is an instance of a class
The most important difference between a class and a class is what messages can be sent to it.
5) A specific type of object can accept the same message
2. Each object has an interface
2.1 Interface (interface)
Class 2.2 Describes a collection of objects with the same attributes (data elements) and behaviors (functions)
2.3 A class is a type of data
2.4 Each object can satisfy only certain message requests, which are defined by the interface of the object
Light LT = New Light ();
Lt.on ();
The name of the object is LT (LT is just a reference to the light object, and here it is the light object) the type of LT is light
Sending a light-on request to this object requires declaring the object's Reference Lt sends a message that the on () format is Lt.on ();
3. Service for each object 4. The specific implementation that is hidden
- Class Creator
- Client Programmer
- Access rights: Public Private protected default
5. Multiplexing specific implementations
5.1 Code reuse is one of the greatest benefits of object-oriented programming languages
5.2 Create a member object: The object of a class to a new class (this object can make a reference to an instance of a class can also be a basic data type)
5.3 Combination: Building a new class with an existing class (by creating a member object, the member object in the new class is generally private, so that the client programmer does not use it)
5.4 Creating a new class is the first consideration of combining
6. Inheriting extends7. Interchangeable objects with polymorphism 8. Single-Root inheritance structure
- Ultimate base Class Object
9. Containers
9.1 An object type that holds references to other objects
9.2 Parameterized Types---> Generics
10. Creation and lifetime of objects
- Heaps (heap)
- Stacks (stack) is a stack
11. Exception handling, handling error 12. Concurrent Programming 13. Java and the Internet
Introduction to the first chapter of the Java programming thought note