Home » Java Programming » Assertions

Which of the following statements is true?

Correct Answer: It is sometimes good practice to throw an AssertionError explicitly.

Explanation:

Option A is correct because it is sometimes advisable to thrown an assertion error even if assertions have been disabled.


Option B is incorrect because it is considered appropriate to check argument values in private methods using assertions.


Option C is incorrect; finally is never bypassed.


Option D is incorrect because AssertionErrors should never be handled.


← Previous Question Next Question→

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion