Question: Explain the difference between 'throw' and 'throws' in Java.Answer: 'throw' is used to explicitly throw an exception, while 'throws' is used in method signature to declare that the method may throw one or more types of exceptions. |
Is it helpful?
Yes
No
Most helpful rated by users: