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

Is it possible to compare various strings with the help of == operator?

552


What an i/o filter?

567


Do I need java for windows 10?

555


What is anagram number?

458


Explain with example the concept of constant variable in java.

640






What are voids?

539


What is the difference between compile-time polymorphism and runtime polymorphism?

570


What is the difference between integer parseint and integer valueof?

557


What are the ways to instantiate the class class?

604


What do you mean by aggregation?

574


What is floor in java?

564


What is a java string?

547


What is strings in java?

591


Why are getters and setters used?

576


Enlist few advantages of inheritance?

588