Containment

Containment

Containment or composition is the process of adding another class as a member of a class. For example, a Person class can have a field of type Name. The program below shows an example…