+ 1

What is the difference between throws,throw and Throwable?

15th Sep 2019, 6:33 PM
Wajeeha Farooqui
Wajeeha Farooqui - avatar
2 Answers
0
Throwable is the parent class of both Error and Exception classes. throw is a statement which is defined in Throwable, as Exceptions are not "called" but "thrown". When you know about (possible) scenarios which may cause an exception while using your method, you can write some handling for it, then you use throws.
15th Sep 2019, 7:05 PM
Nonea
Nonea - avatar