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



What is the relationship between a method?s throws clause and the exceptions that can be thrown du..

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

What is the relationship between a method?s throws clause and the exceptions that can be thrown du..

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

Post New Answer

More Core Java Interview Questions

How much is a java license?

0 Answers  


How can we handle runtime exceptions? write one sample program? Can we write runtime exceptions beside the throws key word? if yes write sample program?

1 Answers   Huawei,


Is java owned by oracle?

0 Answers  


Can we overload destructor in java?

0 Answers  


Why we override equals() method?

0 Answers  






Name few java 8 annotations ?

0 Answers  


What is the synonym of string?

0 Answers  


What is the driver class?

0 Answers  


How many wrapper classes are there in java?

0 Answers  


What is compareto () in java?

0 Answers  


where singleton classes are used in j2ee web application.can we use it for connection pooling.

1 Answers  


What are default methods ?

0 Answers  


Categories