One
Object. The concept of a member, which has not been described before, is now a discussion of members.
After describing the finished thing, it has properties and behavior. Both property and behavior are part of things. As long as it is part of this thing, we call it a member.
Members are divided into two types, one called member function, and one called member variable.
Defining a class is the member in the definition class.
Before we learned the local variables, we learned the member variables, the variables are defined in different positions. Member variables are defined in a class and are scoped to the entire class. Local variables can only be valid in methods.
The main function is not defined in the car class. Car This class is designed to describe a particular class of things, and it does not need to run independently. This thing is used before it needs to run.
How to use it? Given the drawing, the object is created according to the drawing and finally the object is used.
We often just need to describe, not run. If it is possible to run, write a main function in the class, but it is not necessary.
There are a lot of descriptions of a thing, we do a lot of descriptions in one class, we create entities in another class, we call them.
Java-Preliminary Understanding-sixth-class-to-object relationship (details)