Meaningless Drivel is fun!
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes a question about assert Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "a question about assert" Watch "a question about assert" New topic

a question about assert

avseq anthoy
Ranch Hand

Joined: Apr 27, 2004
Posts: 106
I see Sun Certified programmer & developer for java 2 write this:
Do not use assert expressions that can cause side effects!
but I can't understand its meaning.
Can someone explain it more detail?



My Way,My Pace
Chris Allen
Ranch Hand

Joined: Feb 01, 2003
Posts: 127
I believe the intent is to not build logic based on the assert statement that would not be available when the compile is done turning off assertions. One example I can think of is to base some logic that wraps an assert statement in an if statement. Bottom line, the assert should be used for debugging purposes, not to control logic.
avseq anthoy
Ranch Hand

Joined: Apr 27, 2004
Posts: 106
Thanks for your replying.
I can understand now!
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: a question about assert
It's not a secret anymore!