Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Data metodo = new Data();
- Scanner entrada = new Scanner(System.in);
- int operacion = 0;
- String ultimo="";
- //menú que se muestra en pantalla
- System.out.print("n ->Seleccione la opcion deseada: ");
- operacion = entrada.nextInt();
- try {
- switch (operacion) {
- case 1:
- ultimo="ejercicio73";
- metodo.ejercicio73();
- break;
- //...Aquí van el resto de opciones
- default:
- System.out.println("Opcion fuera de rango");
- menuPrincipal();
- } catch (NumberFormatException e) {
- JOptionPane.showConfirmDialog(null, "El valor ingresado debe ser de tipo entero", "ADVERTENCIA", JOptionPane.PLAIN_MESSAGE);
- //Aquí quiero llamar llamar el ultimo método al que ingreso a usando la variable "ultimo"
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement