You are viewing a single comment's thread. Return to all comments →
can't it be possible that , we print the required output by using the object of exception we passed in the catch block .
above program print Exception with the causal , but the required output is without causal ?
By this u handled InputMismatchException......but what about other types of exception
How u will handle them
for other exceptions , we will have to first put specific catch block for that specific exceptions still if there is some possibility that other exception might get raised put a generic catch block for handeling all exceptions .