What are the different ways to handle exceptions?
Answers
Answered by
0
An exception is an unwanted or unexpected event, which occurs during the execution of a program i.e at run time, that disrupts the normal flow of the program’s instructions
Answered by
0
There are two ways to handle exceptions :
i. By wrapping the desired code in a try block followed by a catch block to catch the exceptions.
ii. List the desired exceptions in the throws clause of the method and let the caller of the method hadle those exception.
Similar questions
Hindi,
7 months ago
Social Sciences,
7 months ago
English,
1 year ago
English,
1 year ago
Math,
1 year ago