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

What is lambda in java?

515


Is 9 a prime number?

463


what is thread in Java ?

618


What is public static void main?

565


Which package is used for pattern matching with regular expressions?

642






What are the two ways to create a thread?

530


Can an interface have a constructor?

511


Write a program in java to find the maximum and minimum value node from a circular linked list.

516


What is a data structure java?

500


What is the main purpose of serialization in java?

525


How do you check if an arraylist is not empty?

573


What is the protected method modifier?

561


What are kinds of processors?

561


What is object class in java?

501


Can static methods be inherited?

533