kayleighanne2330 kayleighanne2330
  • 03-07-2019
  • Computers and Technology
contestada

When an object of one class is a data field within another class, they are related by ____.

a.
composition

b.
extension

c.
is-a

d.
scope

Respuesta :

Branta Branta
  • 11-07-2019

Answer:

a. composition

Explanation:

When an object of one class is a data field in another class, the two classes are related by composition. In particular the containing class is composed using the contained class. For example:

class container {

    contained  c;

    int a;

}

class contained {

    int b;

}

Here the container class is containing an instance of contained class creating a composition relation.

Answer Link

Otras preguntas

When did humans get the idea/material for artworks
why does the moon orbit the earth
Why does Richard’s invention work so well? How does it keep the lions away from the livestock without harming them? Use specific evidence from the text to suppo
What value of x makes the equation true? −4(x−3)=−28
Why does the author most likely include these details?to illustrate that young activists pressure others to donate moneyto show that young activists are more ge
Reasons why it is important to do proper maintenance and safety of kitchen tools and equipment.
PLEASE HELP ME I DONT UNDERSTAND THIS AND THIS IS TIMED In an experiment, a rubber stopper is attached to one end of a string. The stopper is whirled in a horiz
what does a red flag with a diagonal white stripe mean
What is the scale factor of the dilation of figure A to figure B? A. 2-3 B. 3-2 C. 2 D.3
2. It was bored d------- when I awake.​​