Prev Next

Testing / Junit Interview questions II

How will you test a method with private access modifier?

There is no way to test it as the private method can not be accessed outside of the class. Manual testing may be performed or use of Reflection API could help. Also consider changing the access modifier to protected.

More Related questions...

Show more question and Answers...


Comments & Discussions