Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Ejercicio1DosYTres {
- public double dividir(double a,double b){
- // como crear excepcion? metodo main?
- double resultado = 0;
- try{
- resultado = (a/b);
- } catch (ArithmeticException e){
- System.out.println("No se pudo ejecutar la division");
- } finally{
- System.out.println("El codigo se esta ejecutando");
- }
- return resultado;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment