Page 1 of 1

About Question enthuware.ocpjp.v7.2.1362 :

Posted: Sun Jun 05, 2016 4:57 am
by Artem Voronov
How all of these code snippets given in options 1, 2, and 3, can be appropriate? All methods are public and for such cases we should throw exceptions, not assert errors. The same explanation could be found in other similar questions.

Re: About Question enthuware.ocpjp.v7.2.1362 :

Posted: Sun Jun 05, 2016 6:16 am
by admin
This is as per Oracle's official recommendations given here: http://docs.oracle.com/javase/7/docs/te ... html#usage

The cases given in this code fall under the "Class Invariants" category.

HTH,
Paul.

Re: About Question enthuware.ocpjp.v7.2.1362 :

Posted: Mon Jun 13, 2016 9:59 am
by Artem Voronov
thanks, now it's clear