aspose file tools*
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
Author

a question about assert

avseq anthoy
Ranch Hand

Joined: Apr 27, 2004
Posts: 104
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?

Thanks!

avseq


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: 104
Thanks for your replying.
I can understand now!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: a question about assert