This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Java's exceptions for total beginner Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Java Watch "Java New topic
Author

Java's exceptions for total beginner

André Asantos
Ranch Hand

Joined: Nov 23, 2009
Posts: 234
hi all,
can you help me with any clue how to learn Java's exceptions... Try/Cath/Finally... and the Java's exceptions...

thanks in advance!!!
André AS


André AS
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18139
    
  39

http://java.sun.com/docs/books/tutorial/essential/exceptions/


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Sebastian Janisch
Ranch Hand

Joined: Feb 23, 2009
Posts: 1183
Henry Wong wrote:http://java.sun.com/docs/books/tutorial/essential/exceptions/


let me guess, you googled 'java exceptions tutorial' and followed the first result ?


JDBCSupport - An easy to use, light-weight JDBC framework -
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18139
    
  39

Sebastian Janisch wrote:
let me guess, you googled 'java exceptions tutorial' and followed the first result ?


Actually, no. The Sun tutorial, for something that is free, is actually pretty good. I always recommend it .

Henry
salvin francis
Ranch Hand

Joined: Jan 12, 2009
Posts: 917

Sebastian Janisch wrote:
Henry Wong wrote:http://java.sun.com/docs/books/tutorial/essential/exceptions/


let me guess, you googled 'java exceptions tutorial' and followed the first result ?


I find that a bit harsh, especially coming from a user who contributed nothing in this thread,



André Asantos,

basically there are 3 parts to it:




The code you would write in part1 is the code that might throw an exception.
The code you would write in part2 is the code that should run when an exception is "caught"
The code you would write in part3 is the code that should run regardless of an exception after the try block, This code executes even when an exception not caught by the catch block occurs.

You can write several catch blocks:



also finally can be excluded altogether,

for more information you can refer henry's link.


My Website: [Salvin.in] Cool your mind:[Salvin.in/painting] My Sally:[Salvin.in/sally]
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36592
    
  16
Remember you do not necessarily have to catch any Exception where it occurs; there will be more about that in the Java™ Tutorials link which Henry gave yesterday.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java's exceptions for total beginner
 
Similar Threads
Is Java Pure Object Oriented?
File transfer problem
writing from a jar
difference between throw and throws
try without catch