Meaningless Drivel is fun!
The moose likes Beginning Java and the fly likes How can i use assertions in java? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How can i use assertions in java?" Watch "How can i use assertions in java?" New topic

How can i use assertions in java?

Ammar Salem
Ranch Hand

Joined: Dec 29, 2007
Posts: 60
Hello guys, i need to know what are Assertions and how they differ from exceptions,why do we need them? i really need help? my book doesnt help much.

****************************<br />For Some Dreams.....<br />One Lifetime Is Not Enough.<br />****************************
Jilesh Lakhani
Ranch Hand

Joined: Jul 26, 2006
Posts: 49

Universe and Knowledge has no bounderies
camilo lopes
Ranch Hand

Joined: Aug 08, 2007
Posts: 202
do you use assert only for test if one line of your code is error or was config for false.
Assert not can to be use in place of IF. Assert is a good programming practice.

Brazil - Sun Certified Java Programmer - SCJP 5 About Java - Update every Week.
Guide SCJP - tips that you need know
jQuery in Action, 3rd edition
subject: How can i use assertions in java?
It's not a secret anymore!