Home / Questions / What is the role of(i) throws keyword?(ii) throw keyword?
Explanatory Question

What is the role of
(i) throws keyword?
(ii) throw keyword?

👁 18 Views
📘 Detailed Answer
🕒 Easy to Read
Read the answer carefully and go through the related questions on the right side to improve your understanding of this topic.

Answer with Explanation

(i) throws keyword?

Answer: Declares exceptions that a method may pass to the calling method.

(ii) throw keyword?

Answer: Used to explicitly throw an exception.