ShortCalculator.java 412B

123456789101112131415161718192021222324252627282930
  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. }