Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

Relationships between classes#

Sumit Rawal answered on May 17, 2023 Popularity 6/10 Helpfulness 1/10

Contents


More Related Answers

  • one to many relation between objects
  • Defining Relationships between Entities
  • illustrate the relation between class and object

  • Relationships between classes#

    0

    There are three main class relationships we need to know:

    IS A

    Part-of

    Has-a

    Part-of

    In this relationship, one class object is a component of another class object. Given two classes, class A and class B, they are in a part-of relation if a class A object is a part of class B object, or vice-versa.

    An instance of the component class can only be created inside the main class. In the example to the right, class B and class C have their own implementations, but their objects are only created once a class A object is created. Hence, part-of is a dependent relationship.

    Popularity 6/10 Helpfulness 1/10 Language whatever
    Source: Grepper
    Link to this answer
    Share Copy Link
    Contributed on May 17 2023
    Sumit Rawal
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.