123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- public class Operations {
-
- /**
- * The addition function.
- * @param x The first operand
- * @param y The second operand
- * @return the sum of x and y
- */
- public static int add(int x, int y) {
- return x + y;
- }
-
- /**
- * The subtraction function
- * @param x The first operand
- * @param y The second operand
- * @return y taken from x
- */
- public static int subtract(int x, int y) {
- return x - y;
- }
-
-
- /**
- * The multiplication function
- * @param x The first operand
- * @param y The second operand
- * @return x times y
- */
- public static int multiply(int x, int y) {
- return x * y;
- }
-
-
- /**
- * The division function
- * @param x The first operand
- * @param y The second operand
- * @return x divides y
- */
- public static int divide(int x, int y) {
- return x / y;
- }
- }
|