Wouldn't printStackTrace be better, it shows also the line number and the error. Just by using catch Execption errror
package com.codegym.task.task09.task0907;
/*
Exception when working with numbers
*/
public class Solution {
public static void main(String[] args) throws Exception {
//write your code here
try {
int a = 42 / 0;
} catch (Exception e) {
e.printStackTrace();
}
//write your code here
}
}