Advertisement
Guest User

Untitled

a guest
Feb 14th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1.  
  2. public class Testmain {
  3.  
  4. public static void main(String[] args) {
  5. // TODO Auto-generated method stub
  6.  
  7.  
  8. IntCalculator x;
  9. try{
  10. x = new IntCalculator (8,6);
  11.  
  12. x.displayDetail();
  13. }
  14. catch (CEDNumberException e){
  15.  
  16. System.err.println (e.getErrorMessge());
  17. }
  18.  
  19. catch (CEDDividedByZeroException e) {
  20. String msg = e.getErrorMessge();
  21. System.err.println(msg);
  22.  
  23. }
  24. }
  25. }
  26.  
  27. //int add = x.add();
  28. // int subtract = x.subtract();
  29. // int multiply = x.multiply();
  30. // int divide = x.divide();
  31.  
  32.  
  33. // System.out.println ("X="+x.getX());
  34. // System.out.println ("Y="+x.getY());
  35. // System.out.println ("add+ x+y=" + add);
  36. // System.out.println ("subtractx x-y = "+subtract);
  37. // System.out.println ("multiply x*y = "+ multiply);
  38. //System.out.println ("divide x/y =" +divide);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement