1.

For wrtiting favourable tests, __________ is perferred over inheritance.(a) Encapsulation(b) Polymorphism(c) Overloading(d) CompositionThis question was addressed to me during an online interview.Origin of the question is JMock topic in chapter Testing with Mock Objects of JUnit

Answer»

The correct option is (d) Composition

The EXPLANATION is: Composition is a BETTER code re-use mechanism.



Discussion

No Comment Found

Related InterviewSolutions