How can you catch multiple exceptions in java?

devquora
devquora

Posted On: May 26, 2021

 

With the help of Java catch multiple exceptions you can catch multiple exceptions. In this method a try block can be followed by one or more catch blocks such that each catch block must contain a different exception handler. Now you can use java multi-catch block.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    Cyient Java developer Interview Questions

    List types of storage classes in java?

    There are basically four types of storage classes in Java:Automatic storage class: When a variable that is used in the coding is defined within a function and that also with the auto specifier the...

    Cyient Java developer Interview Questions

    Write a java program to generate Fibonacci series?

    A JAVA program to generate Fibonacci series is as follows: import java.util.Scanner; public class Fibonacci { public static void main(String[] args) { int n, a = 0, b = 0, c = ...

    Cyient Java developer Interview Questions

    How does the garbage collector work in Java?

    Garbage collection is the process of automatically managing memory in java. It is helpful to finds the unused objects that are no longer used by the program and deletes or remove them to free up the m...