This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Java in General and the fly likes throws Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "throws Exception" Watch "throws Exception" New topic
Author

throws Exception

Cham Wick
Greenhorn

Joined: Dec 28, 2011
Posts: 8
According to above code why don't we need try...catch block to execute "a.start();"
I'm new to java and as far as I know it needs a try...catch block to execute a method code if it thorws an Exception


[HENRY: added code tags]
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 19932
    
  43

Cham Wick wrote:According to above code why don't we need try...catch block to execute "a.start();"
I'm new to java and as far as I know it needs a try...catch block to execute a method code if it thorws an Exception



ArithmeticException exceptions are unchecked exceptions.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Cham Wick
Greenhorn

Joined: Dec 28, 2011
Posts: 8
Thanks
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: throws Exception
 
jQuery in Action, 3rd edition