public class Matematicas { public double dividir(double a, double b) throws Exception { if (a<0) { throw new RuntimeException("El argumento a no puede ser negativo"); } if (b<0) { throw new RuntimeException("El argumento b no puede ser negativo"); } if (b == 0) { throw new Exception("El argumento b no puede ser 0"); } return a / b; } }