MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

SOFTWARE ENGINEERING

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
SampleClass and Class3 has composition relationships
A
true
B
false
C
Either A or B
D
None of the above
Explanation: 

Detailed explanation-1: -In a composition association relationship, data usually flows in only one direction (that is, from the whole classifier to the part classifier). For example, a composition association relationship connects a Student class with a Schedule class, which means that if you remove the student, the schedule is also removed.

Detailed explanation-2: -1) If A and B two classes are related to each other such that, B ceased to exist when A is destroyed, then the association between two objects is known as Composition. An example is Car and Engine.

Detailed explanation-3: -In Java, a Has-A relationship is otherwise called composition. It is additionally utilized for code reusability in Java. In Java, a Has-A relationship essentially implies that an example of one class has a reference to an occasion of another class or another occurrence of a similar class.

Detailed explanation-4: -Composition Relationship is a relationship between a whole object and one of its integrated parts. In short, it can be say to be a whole-part relationship; it is also commonly referred to as has a relationship.

There is 1 question to complete.