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

Which of the following statements is false?
Need help please and check your answer
Plz helpThis diagram best represents which outlook during the late 19th and early 20th centuries? A. Social Darwinism B. Assimilation C. Anti-Catholicism D. Exp
Find x. Round your answer to the nearest tenth of a degree.
PLS HELP ASAP! 20 PTS evaluate
Starting from rest, two skaters push off against each other on smooth level ice, where friction is negligible. One is a woman and one is a man. The woman moves
Geometry Find the value of x in each of the given figures . Need help please.
URGENT PLEASE HELP 25 POINTS!!! A generator produces 5 megawatts (MW) of power. How many watts (W) are produced?
“People said we could not complete this park. But they were wrong. We found a way, fought back, and finally finished.” What rhetorical device is being used in t
HELP PLS. Team A built 8 sandcastles in 2 hours and Team B built 5 sandcastles in 1 hour. Which team worked at a faster rate?​