Java provides to catch multiple exceptions in single catch block. but this is confusing for me. how can I know which exception is caught in this block ? and normally a variable in java has only one type. so how can e
variable have too many types ?
Example
try {
// codes
// ...
// ..
// .
} catch(InturreptedException | FileNotFoundException | AnotherException e) {
// how can I know what the type of `e` is ?
}