Java learning the relationship between 8--classes (objects)

Source: Internet
Author: User

(End of base syntax, start looking at object-oriented)

Association

Correlation is a dependency of the semantic level between the two classes, like me and my teacher.

Inheritance (General and special)

Inheritance refers to the ability of a class to inherit another class, and it can add new functionality, and the semantics of "xx is a AA" conform to the meaning of inheritance. "Monkey is an animal" can be abstracted as "monkey" Inherit "Animal class".

Aggregation (whole and part)

aggregation , the whole and the part are separable, can have their own life cycle. Some objects can belong to more than one whole, or you can

Share for multiple objects, such as players and teams, coaches and teams.

combination , the whole and the part is not divided, the whole life cycle end also means that part of the life cycle end, such as a person has head body, head and body is a combination.

Realize

Refers to a class that implements its interface functionality.

Polymorphic

Java learning the relationship between 8--classes (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.