diff --git a/src/com/jwetherell/algorithms/mathematics/Division.java b/src/com/jwetherell/algorithms/mathematics/Division.java index c133f741..f9bb96e8 100644 --- a/src/com/jwetherell/algorithms/mathematics/Division.java +++ b/src/com/jwetherell/algorithms/mathematics/Division.java @@ -3,7 +3,12 @@ public class Division { public static final long division(int a, int b) { - long result = ((long) a) / ((long) b); + // Expection Handler + try { + long result = ((long) a) / ((long) b); + } catch (IllegalArgumentException e) { + System.out.println("Dividing by zero"); + } return result; }