Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class TryCatch {
- public static void main(String[] args) {
- int num=7, denom=0, result;
- try {
- result = num/denom;
- }
- catch (ArithmeticException mistake)
- {
- System.out.println("Attempt to divide by zero");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement