What is the relationship between a method?s throws clause
and the exceptions that can be thrown during the method?s
execution?
Answers were Sorted based on User's Feedback
Answer / ranganathkini
The throws clause of a method basically defines the types of
checked exceptions the method can throw during its
execution. This clause alerts the client code that invokes
the method that it has to have suitable try...catch blocks
to handle the checked execeptions.
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / chinu
Throws is used in the method definition to mark what all
exceptions the method can throw, so that the code that
accesses the method can give the corresponding catch block
for that exception.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is integer parseint?
What is replacefirst in java?
how you will prevent method overriding?
What are 3 boolean operators?
Can you declare a static variable in a method?
what are depricated methods in threads and explain the lifecycle methods
Why can't we make a class private in java?
How to access a variable if it is declared as private?
What is the difference between JDK and JVM?
Can we have two methods in a class with the same name?
What is deserialization and how do we do deserialization?
What is the parse method in java?