IBM
C2170-010 · Question #8
Review the following diagram: [Image of StructA and StructB definitions] After a build generated, which of the following assign methods is generated on StructA?
The correct answer is D. public StructA assign(StructB structB){ structA.attribute1 = structB.attribute1; structA.attribute2 = structB.attribute2; structA.attribute3 = structB.attribute3; structA.attribute4 = structB.attribute4; structA.attribute5 = structB.attribute5; }. See the full explanation below for the reasoning.
Question
Review the following diagram:
[Image of StructA and StructB definitions]
After a build generated, which of the following assign methods is generated on StructA?
Options
- Apublic StructA assign(StructB structB){ structA.attribute1 = structB.attribute1; structA.attribute2 = structB.attribute2; structA.attribute3 = structB.attribute3; structA.attribute4 = structB.attribute4; }
- Bpublic StructA assign(StructB structB){ structA.attribute4 = structB.attribute5; }
- Cpublic StructA assign(StructB structB){
- Dpublic StructA assign(StructB structB){ structA.attribute1 = structB.attribute1; structA.attribute2 = structB.attribute2; structA.attribute3 = structB.attribute3; structA.attribute4 = structB.attribute4; structA.attribute5 = structB.attribute5; }
How the community answered
(29 responses)- A7% (2)
- B10% (3)
- C3% (1)
- D79% (23)
Community Discussion
No community discussion yet for this question.