This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Assertions Doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Assertions Doubt" Watch "Assertions Doubt" New topic
Author

Assertions Doubt

Jas Oberai
Ranch Hand

Joined: Jan 16, 2005
Posts: 231
Hi Friends,
I have some doubt understanding these statement,can someone please throw in some simple example(code) for each of these cases:
case1:The assert statement is being used to check a postcondition--
something that must be true when the method completes successfully.

Case2:The assert statement is being used to check a class invariant--
something that must be true about each instance of the class.

Case3:The assert statements are being used to check a precondition--
something that must be true when the method is invoked.

Thanks in Advance!!!


SCJP 1.4 (88%)<br />SCWCD 1.4 (88%)
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Assertions Doubt
 
Similar Threads
dan exam doubt 13
Assertions
Assertion
Assertions Doubts
dan exam doubt 12