Any Exception that can be thrown by a method is part of the method's public programming interface. Those who call a method must know about the exceptions that a method can throw so that they can decide what to do about them. These exceptions are as much a part of that method's programming interface as its parameters and return value.
Java
Topic: Exceptions
Why did the designers decide to force a method to specify all uncaught checked exceptions that can be thrown within its scope?
Browse random answers:
What is an Exception?
What is a Java Exception?
What are the different ways to generate an Exception?
Where does Exception stand in the Java tree hierarchy?
Is it compulsory to use the finally block?
How are try, catch and finally block organized?
What is a throw in an Exception block?
What is the use of throws keyword?
What are Checked Exceptions and Unchecked Exceptions?
What are Chained Exceptions?
Exceptions are defined in which java package?
What is Runtime Exception or unchecked exception?
What is difference between ClassNotFoundException and NoClassDefFoundError?
How to create custom Exception?
Why did the designers decide to force a method to specify all uncaught checked exceptions that can be thrown within its scope?
Can you give an example of an unrecoverable problem when error is thrown?
Explain the difference between the two approaches of exception handling