Java OCA OCP Practice Question 376

Question

Which of the following are appropriate situations for assertions?

  • A. Pre-conditions of a public method
  • B. Post-conditions of a public method
  • C. Pre-conditions of a private method
  • D. Post-conditions of a private method


B, C, D.

Note

Assertions should not be used to check preconditions of a public method.




PreviousNext

Related