wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Checked Exception in static method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Checked Exception in static method" Watch "Checked Exception in static method" New topic
Author

Checked Exception in static method

rahul deo
Greenhorn

Joined: Jul 05, 2011
Posts: 10
Hi All

Can we throw a checked exception in a static method? I am confused , because till now i know that We can throws only a runtime exception. So if we can throw a checked exception then why and how? Thanks in advance
Rajdeep Biswas
Ranch Hand

Joined: Mar 26, 2012
Posts: 186

I'd recommend you to try to do so. Compiler will let you know, else you can see the behavior during execution. Then you can post here what you found!


The biggest gamble will be to ask a question whose answer you know in that it will challenge your theory | www.TechAspire.blogspot.in
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Sure you can. It makes no difference whether the method is static or not, the same rules apply in both cases.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Checked Exception in static method