ShortCalculator.java 457B

12345678910111213141516171819202122232425262728293031
  1. public class ShortCalculator {
  2. public short sum(short x, short y){
  3. return (short) (x + y);
  4. }
  5. public short subtract(short x, short y){
  6. return (short) (x - y);
  7. }
  8. public short multiply(short x, short y){
  9. return (short) (x * y);
  10. }
  11. public short divide(short x, short y){
  12. return (short) (x / y);
  13. }
  14. public short mod(short x, short y){
  15. return (short) (x % y);
  16. }
  17. }