This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Checked Exception in static method Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply 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: 163

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: 16483
    
    2

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
 
Similar Threads
Exception Handling
Initialization Blocks
overriding and overloading
Runtime Excepiton and Checked Exception
exception as a argument