1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- 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 divide function.
- * @param x The first operand
- * @param y The second operand
- * @return x divided by y
- */
- public static int divide(int x, int y) {
- return x / y;
- }
- }
|