Created
April 25, 2018 23:38
-
-
Save K0che/ada88a2db2363a983f60a0dd5c256a63 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public final class Math { | |
private Math() {} | |
public static int add(int firstNumber, int secondNumber) { | |
return firstNumber + secondNumber; | |
} | |
public static int multiply(int multiplicand, int multiplier) { | |
return multiplicand * multiplier; | |
} | |
public static double divide(int dividend, int divisor) { | |
if (divisor == 0) | |
throw new IllegalArgumentException("Cannot divide by zero (0)."); | |
return dividend / divisor; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment