Handle ArithmeticException using Try Catch in Java

Without TryCatch:

Output:

With TryCatch:

Output:

 

Leave a Reply

Your email address will not be published. Required fields are marked *