What is difference between throw and throws
throws keyword is being declared in the main function which allow the compiler to find exception while throw send an exception when method try catch is aaplied
throw is used to throw exception to the calling method, that is usually used in catch block..whenever you are using throw keyword ,it is mandatory to mention throws in the method definition by indicating type of exception that method is going to throw.
Throw is used to throw exception explicitly.
Throws is used to declare an exception.
Throw used with methods.
Throws is used with method signature.
Throw can't throw multiple exception
Throws can declare multiple exception.
Throws keyword is used to jst delegating exception to the caller
Throw keyword use to create own exception and handover to the jvm..
Any body knows best site or app for Java discussion
Oh thanks bro
Throws clause in used to declare an exception and thow keyword is used to throw
an exception explicitly.
syntax wise throw is followed by an instance variable and throws is followed by exception class names.