Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void myMethod (int num1, Int num2)
- {
- int result;
- try
- {
- result = num2 / num1;
- }
- catch (ArithmeticException e)
- {
- System.out.printin (Error. division by zero") ;
- }
- System.out.println("Result: " +result);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement