File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes assert Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "assert " Watch "assert " New topic


rani bedi
Ranch Hand

Joined: Feb 06, 2001
Posts: 358
I recently saw a program using the assert keyword. Hopefully it looked to me as a statement. Can anyone comment.
assert index > 0 : baseValue ;

Cheers,<br />Rani<br />SCJP, SCWCD, SCBCD
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
This is not available in java. Here is an article discussing how you could CHOOSE to implement it if you want to:

"JavaRanch, where the deer and the Certified play" - David O'Meara
Julia Reynolds
Ranch Hand

Joined: May 31, 2001
Posts: 123
I read somewhere that we will have assert in JDK 1.4.
Mapraputa Is
Leverager of our synergies

Joined: Aug 26, 2000
Posts: 10065
Originally posted by Julia Reynolds:
I read somewhere that we will have assert in JDK 1.4.

Perhaps here:

Uncontrolled vocabularies
"I try my best to make *all* my posts nice, even when I feel upset" -- Philippe Maquet
I agree. Here's the link:
subject: assert
It's not a secret anymore!