Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

throws Exception

 
Cham Wick
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Pie
Posts: 21395
84
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Cham Wick
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic