Can multiple catch statements be used in exceptions ?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the difference between static and dynamic binding in java?

789


What is method reference in java?

804


What is == mean?

739


Why is stringbuffer not immutable?

763


What is the significance of listiterator?

749


What is illegal identifier in java?

744


What is the exact difference in between Unicast and Multicast object?

1749


What are the types of relation?

779


What are the differences between path and classpath variables?

739


Explain about OOPS concepts and fundamentals.

800


What will happen if there is a default method conflict as mentioned above and we have specified the same signature method in the base class instead of overriding in the existing class ?

712


Difference between this() and super() ?

761


Why is multiple inheritance not supported in java?

758


What are multiple inheritances? Is it supported by java?

658


Explain the difference between arraylist and linkedlist in java?

690