File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Runtime Exception

 
swarupa patil
Ranch Hand
Posts: 62
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers
I have doubt about the RuntimeException.If method1()1 use throws clause
and throws RuntimeException.The rule for exception handelling is calling method to method1() must either caught the exception or throws exception.
Code:
Is this code comile (compile)?why:why not;
public void method1()throws NullPointerException
{
}
public void method2()
{
method2();
}
 
Keith Lynn
Ranch Hand
Posts: 2399
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
RuntimeException, Error, and their subclasses are unchecked.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic