aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes assertion 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 "assertion" Watch "assertion" New topic
Author

assertion

anushree ari
Ranch Hand

Joined: Sep 30, 2002
Posts: 98
Is it possible to enable or disable the assertion form the source code itself?
explain me,
thx


anushree
Dan Chisholm
Ranch Hand

Joined: Jul 02, 2002
Posts: 1865
You can disable the program if assertions are not enabled using something like the following.

If assertions are not enabled the assertsEnabled boolean remains false and the RuntimeException is thrown.


Dan Chisholm<br />SCJP 1.4<br /> <br /><a href="http://www.danchisholm.net/" target="_blank" rel="nofollow">Try my mock exam.</a>
Manish Hatwalne
Ranch Hand

Joined: Sep 22, 2001
Posts: 2578

Assertions can be enabled or disabled programmatically, have a look at ClassLoader class documentation.
HTH,
- Manish
Albert Lee
Greenhorn

Joined: Aug 04, 2002
Posts: 18
you can use // or /* */ to disable assersion statement.


Everyday create your history.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: assertion