java - Can anyone please correct my given statement if its wrong(about throw/throws) -
throw
:-we have handle exception(we in sense user here).
throws
:we asking compiler handle exception raised.
please correct if stated above wrong . if wrong please tell me correct statement.
thanks in adv!
i'd both not exact.
throw
statement causes throwing of exception. no-one has catch however. example runtime exception can thrown without requirement catch them in application code.
throws
keyword allows declare method may throw exception of specific type.
Comments
Post a Comment