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 |
when to use abstract class and when to use interface?
16 Answers Exterro, iGate, IonIdea,
Where and how can you use a private constructor?
Can you explain the usages of class.forname()?
What does regex mean?
can we have function for truncating the sign as like abs in oracle.
How can we create an immutable class in java?
What is the range of the char type?
what is the swingutilities.invokelater(runnable) method for? : Java thread
What is an immutable object? How do you create one in java?
What do you understand by final value?
Name the components that are termed to be Heavy-weight component but available in Light-weight components?
What is advantage of java?