Can multiple catch statements be used in exceptions ?
Answers were Sorted based on User's Feedback
yes we can use multiple catch statements in exceptions
for example we r writing the program for databas connection
with some mathametical operations with some network concepts
then we may get arithmatic exception, sql exception, and
netwok exception socket, rmi etc there we need to catch all
thoes using different catch statement
| Is This Answer Correct ? | 7 Yes | 0 No |
Answer / ravikiran(aptech mumbai)
yes multiple exceptions are possible,But the super class of
the particular exeption has to follw the sub claa.Reverse
will not be posible
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / sakthi k
Yes we can use multiple catch statement for the exception.
try
{
Sop("exception");
}
catch(NumberFormatException)
{
}
catch(Exception)
{
}
we have to include the child exception above the parent
exception otherwise it shows an error. .
| Is This Answer Correct ? | 0 Yes | 0 No |
What are the approaches that you will follow for making a program very efficient?
What is java util function?
how many design pattern r there? and wht design pattern u use and why ?
where u use Abstraction and Interface in real time
Is string a class?
Why are the methods of the math class static?
What is emant by API? is it related to java only or it is common for all OOPS supporting language?
Can inner class be public in java?
how many access specifiers are available in java
How many types of constructors are used in java?
How do you execute a thread in java?
How many types of interfaces are there?