Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Why can't we write throw new Exception(); without try catch block ?

 
devasis majhi
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When we can write throw new ArithmeticException(); without a try catch block why can't we write throw new Exception(); without try catch block.
To generalize we can throw a RuntimeException without try catch block but we can't throw a checked Exception without try catch block. What is the reason behind it?
 
Campbell Ritchie
Marshal
Posts: 52617
119
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you know the essential difference between an Exception and a RuntimeException? Have a look at the Java Tutorials, which explains it.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!