Skip to content

Instantly share code, notes, and snippets.

@K0che
Created April 25, 2018 23:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save K0che/ada88a2db2363a983f60a0dd5c256a63 to your computer and use it in GitHub Desktop.
Save K0che/ada88a2db2363a983f60a0dd5c256a63 to your computer and use it in GitHub Desktop.
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