I want to create a split method (double a, double b) that has try / catch to get the Arithmetic Exception, returning an error message by System.out.println; as it is not in the main method, I do not know how it has to be the signature of the method, return, etc. I needed something like this:
public static ? divide(double dividendo, double divisor){
try{
return dividendo/divisor;
}
catch(ArithmeticException e){
System.out.println("Erro: divisão por zero!");
}
}