ShortCalculator.java 557B

123456789101112131415161718192021222324252627282930313233343536373839
  1. public class ShortCalculator {
  2. public short sum(short num1, short num2){
  3. return (short)(num1 + num2);
  4. }
  5. public short diff(short num1,short num2){
  6. return (short)(num1 - num2);
  7. }
  8. public short prod(short num1, short num2){
  9. return (short)(num1 * num2);
  10. }
  11. public short quot(short num1, short num2){
  12. return (short)(num1 / num2);
  13. }
  14. public short remain(short num1, short num2){
  15. return (short)(num1 % num2);
  16. }
  17. }