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 role of void keyword in declaring functions?
Write java program to reverse string without using api?
Write a function to print Fibonacci series and Tribonacci series?
Explain the difference between static and dynamic binding in java?
Is binary a low level language?
What are streams in java 8?
What is bifunction in java?
How do you ensure that n threads can access n resources without deadlock?
Explain the difference between intermediate and terminal operations in java8?
What are inner classes or non static nested classes in java?
Give few examples of final classes defined in Java API?
How dead lock situation occurs in java and how you can identify it?
How a variable is stored in memory?
Why Java doesn’t support multiple inheritance?
Can we pass a primitive type by reference in java? How