ShortCalculator.java 509B

1234567891011121314151617181920212223242526272829
  1. public class ShortCalculator {
  2. short x = (short) 65534;
  3. short y = (short) 65533;
  4. public short add(short x, short y){
  5. return (short) (x + y);
  6. }
  7. public short subtract(short x, short y){
  8. return (short) (x - y);
  9. }
  10. public short multiply(short x, short y){
  11. return (short) (x * y);
  12. }
  13. public short divide(short x, short y){
  14. return (short) (x / y);
  15. }
  16. public short remainder(short x, short y){
  17. return (short) (x % y);
  18. }
  19. }