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

Why was Emmeline Pankhurst significant?
What method of generating electricity doesn't make use of a rotating generator?
solove. draw and lable a tape diagram to subtract tens. write the new number sentence.a. 23 - 9 = 24 - 10 =
A restaurant has two pastry ovens. When both ovens are used, it takes about 3 hours to bake the bread needed for one day. When only the large oven is used, it t
What role should the government have in enforcing equal rights for Americans?
I would like to know if 1 km is greater or less then 999 m
How much does 3000 kg = to get tons
Which of the following was not one of the four bodily humours? a) choler b) blood c) cholesterol d) black bile e) phlegm
Which of the following was not one of the four bodily humours? a) choler b) blood c) cholesterol d) black bile e) phlegm
What is the complete predicate of the following sentence?sharon and Jason went for a walk then a bike ride