Java Classes and objects

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.