1.

JUnit test methods must compulsorily return what value?(a) String(b) int(c) Object(d) voidThis question was addressed to me in an interview for internship.The doubt is from Exploring Core JUnit topic in section Exploring Core JUnit of JUnit

Answer»

The correct OPTION is (d) void

For explanation: If a JUnit TEST METHOD is declared to return ANYTHING then file will compile successfully. But the execution will fail because JUnit requires all test methods to be declared to return void.



Discussion

No Comment Found

Related InterviewSolutions