Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Pr3a {
- public static void main(String args[]) {
- try {
- int result = divide(10, 0);
- System.out.println("Result:" + result);
- } catch (ArithmeticException e) {
- System.err.println("Error:Division by Zero.");
- }
- }
- public static int divide(int a, int b) {
- return a / b;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement