| 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
|
|
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.
|
 |
 |
|
|
subject: Can we throws unckecked exception?
|
|
|