Java Method Signature Throws Exception, Implementation does not -


i looking exception 1 method throwing. method looks this:

public void somemethod() throws somecheckedexception{    //dosomething statements   //but no statements throws 'somecheckedexception'  } 

my question is possible make method throw 'somecheckedexception' while implementation not have throw statement @ all.

is wrong put throw exception in signature without implement statement throwing exceptions?

this fine. throw statement in method signature there in case method throws actual exception declared in throws statement , pass handling different class need remember put such method try catch statement when want use it.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -