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
What is diamond operator in java?
What is methods in java?
Explain features of interfaces in java?
In a program, initializing an array of 100 KB is throwing an out of memory exception while there is 100 MB of memory available. Why?
How many types of memory areas are allocated by jvm?
What are different types of arrays?
What is canonical name in java?
Differentiate between the constructors and methods in java?
What is advantage of java?
How does varargs work in java?
What are the uses of synchronized keyword?
What do you understand by Header linked List?
Why do we use string?
What is Gang of four design patterns
Difference between default and protected access specifiers?