File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
Author

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.
Ammar


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

Joined: Jul 26, 2006
Posts: 49

http://java.sun.com/developer/technicalArticles/JavaLP/assertions/


-Jilesh
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.
example:


Brazil - Sun Certified Java Programmer - SCJP 5
http://www.camilolopes.com/ About Java - Update every Week.
Guide SCJP - tips that you need know http://blog.camilolopes.com.br/livrosrevistaspalestras/
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How can i use assertions in java?