ShortCalculator.java 433B

123456789101112131415161718192021222324
  1. public class ShortCalculator {
  2. public short add(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 remainder(short x, short y){
  15. return (short)(x%y);
  16. }
  17. }