As for the Java classes and objects , as the initial Java I understand, this is like an interpretation of the world.
as there's a lot of in the universe. Planet , like Earth , Mars , Mercury , Moon , Sun and so on. Then we can think of Planet as a class, , Mars , Mercury , Moon , Sun, etc. is Planet Each
that is instantiated by this class
and then there are a lot of organisms on the earth , like tree , bird , people and so on . Then we can think of the creature as a class again, , Bird , man and so on is the creature The individual objects that this class instantiates. Another example is people also have many kinds of
, people as a class again, like Caucasian , Black , yellow people, etc. is person the individual objects to which this class is instantiated. So a class is a category, and an object is like a
This category is instantiated and materialized. So why do we put , , Mercury , Moon , The Sun is said to be a planet, but not to , bird , people, etc. also said to be a planet? Because Earth , Mars , Mercury , Moon , The Sun is all
Have the same characteristics, while trees , birds , people and so on are not. In other words, the earth , Mars , Mercury , the Moon , the Sun , there are other things not. They are also precisely because of these unique characteristics, so they form a class ;
Because of these unique characteristics, they are the objects of this class .
Java Classes and objects