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 How can i use assertions in java? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Software Craftsman this week in the Agile forum!
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
I agree. Here's the link:
subject: How can i use assertions in java?