aspose file tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Can we throws unckecked exception? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply Bookmark "Can we throws unckecked exception? " Watch "Can we throws unckecked exception? " New topic
Author

Can we throws unckecked exception?

anmol meghadambar
Greenhorn

Joined: May 24, 2012
Posts: 4
please help me out ,Can we use throws with unchecked exception?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 16483
    
    2

Yes.

(There would not be much point in an exception that could not be thrown, would there?)
Anayonkar Shivalkar
Bartender

Joined: Dec 08, 2010
Posts: 1295

anmol meghadambar wrote:please help me out ,Can we use throws with unchecked exception?

Now you've already got the answer, but the best approach for such doubts is - to try it out yourself

And Welcome To CodeRanch!


Regards,
Anayonkar Shivalkar (SCJP, SCWCD, OCMJD)
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

most of the time, throws checked exception would help user to realize his fault and throw unchecked exception would help your api client or you to log for debugging.

I dont like to throws unchecked exception.

*throws - method declaration and throw throwing an exception object.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can we throws unckecked exception?
 
Similar Threads
Exception Handling in Tomcat
Checked and Unchecked Exceptions
constructor and exceptions
From JQPlus : QuestionID 957711112180
exception