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 are recursive functions? Give some examples?

704


Why do we need singleton class?

640


Is it possible for a yielded thread to get chance for its execution again?

609


What is the difference between the font and fontmetrics classes in java programming?

584


Where is stringbuffer stored?

640






Which one will take more memory: an int or integer?

858


How does hashset work in java?

673


What is thread pool in java with example?

637


Explain the polymorphism principle?

670


What is the technique adopted to create an immutable class?

634


Which is bigger float or double java?

620


How to make object serializable in java?

642


Can we use switch statement with strings?

707


What is java in layman terms?

622


How many types of the indexof method are there for strings?

584