Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2014
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. class Divider
  2. {
  3. public void methodA()
  4. {
  5. System.out.println("Result: " + 12/4 );
  6. }
  7.  
  8. public void methodB()
  9. {
  10. System.out.println("Result: " + 12/3 );
  11. }
  12.  
  13. public void methodC()
  14. {
  15. System.out.println("Result: " + 12/0 );
  16. }
  17. }
  18.  
  19.  
  20. public class TestTraceEx3
  21. {
  22.  
  23. public static void main ( String[] args )
  24. {
  25. Divider dvdr = new Divider();
  26.  
  27. try
  28. {
  29. dvdr.methodA( );
  30. dvdr.methodB( );
  31. dvdr.methodC( );
  32. }
  33.  
  34. catch ( ArithmeticException oops )
  35. {
  36. oops.printStackTrace();
  37. }
  38.  
  39. }
  40.  
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement