123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. public class Operations {
  2. /**
  3. * The addition function.
  4. * @param x The first operand
  5. * @param y The second operand
  6. * @return the sum of x and y
  7. */
  8. public static int add(int x, int y) {
  9. return x + y;
  10. }
  11. /**
  12. * The subtraction function
  13. * @param x The first operand
  14. * @param y The second operand
  15. * @return y taken from x
  16. */
  17. public static int subtract(int x, int y) {
  18. return x - y;
  19. }
  20. /**
  21. * The multiplication function
  22. * @param x The first operand
  23. * @param y The second operand
  24. * @return x times y
  25. */
  26. public static int multiply(int x, int y) {
  27. return x * y;
  28. }
  29. /**
  30. * The division function
  31. * @param x The first operand
  32. * @param y The second operand
  33. * @return x divides y
  34. */
  35. public static int divide(int x, int y) {
  36. return x / y;
  37. }
  38. }