OCPJP 6
If debugging is the process of removing bugs, then programming must be the process of putting them in. -- Edsger Dijkstra
jishnu dasgupta wrote:Hi all,
As far as i remember shoudlnt assertions be used in such a manner that they do not alter the normal flow of the program??..In that case even in the private method, only if the assertion is enabled, thus the if() loop condition produces an error if it comes true. Otherwise the program operates the same, whether it evaluates to true or false.
OCPJP 6
If debugging is the process of removing bugs, then programming must be the process of putting them in. -- Edsger Dijkstra
OCPJP 6.
In Your Pursuit Towards Certification, NEVER Give Up.
jishnu dasgupta wrote:Hi all,
As far as i remember shoudlnt assertions be used in such a manner that they do not alter the normal flow of the program??..In that case even in the private method, only if the assertion is enabled, thus the if() loop condition produces an error if it comes true. Otherwise the program operates the same, whether it evaluates to true or false.
, that is having the code rely on whether the command line switch "-ea" was present or not when the program is invoked.assert myMethod();
OCPJP 6.0
Don't get me started about those stupid light bulbs. |