File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Assertion Error 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 Error" Watch "Assertion Error" New topic

Assertion Error

Abhi vijay
Ranch Hand

Joined: Sep 16, 2008
Posts: 509
When classifying Assertion Error as being thrown by the JVM or programmatically, why is it said that its thrown programmatically??? Considering assertion is a runtime mechanism??
Punit Singh
Ranch Hand

Joined: Oct 16, 2008
Posts: 952
NumberFormatException, IllegalArgumentException are also runtime mechanism but these are used by java developers in the code.

When you use:

Means you are responsible here to throw AssertionError with message "Illegal value of i".

camilo lopes
Ranch Hand

Joined: Aug 08, 2007
Posts: 202
one point important is that assert is not security that always go to run. to exame is very important pay attention in the question with assertion.
but do not forget that "is not security that assertion go to run always".
to happen one AssertionError normally the programmer did some of mistake.

Brazil - Sun Certified Java Programmer - SCJP 5 About Java - Update every Week.
Guide SCJP - tips that you need know
I agree. Here's the link:
subject: Assertion Error
It's not a secret anymore!