what are the difference between throw and


What are the difference between throw and throws?

Differences are between throws and throw are:

  • Throw is employed to trigger an exception while throws is used in declaration of exception.
  • Without throws, checked exception can't be handled while checked exception can be propagated with throws.
  • Throws is used with the method signature while throw is used inside the method.
  • Throw is followed by an instance however throws is followed by class.

 

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: what are the difference between throw and
Reference No:- TGS0355115

Expected delivery within 24 Hours