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

72 The length of a side of a triangle is 36. A line parallel to that side divides the triangle into two parts of equal area. Find the length of the segment dete
How does storytelling help imagine the future?
An ant travels at a constant rate of 30cm every 2 minutes.At what speed does the ant travel per minute
describe how you can act financially responsible.
Help me with Spanish hw
A 100-watt light bulb radiates energy at a rate of 100 J/s. (The watt, a unit of power or energy over time, is defined as 1 J/s.) If all of the light emitted ha
Stacey filled her 1/2 cup of measuring cup seven times to have enough flour for a cake recipe how much flour does the cake recipe calls for
which of the following sentences most clearly uses topical organization? A. Do you have problems with mosquitoes and gnats? Fabulous Exterminators can help! B.
What is the name of this hydrocarbon?
What is the point slope form of a line with slope -5 that contains point (2,-1)