Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int x;
- System.out.println("Dame un valor numerico:");
- try{
- x=scanner.nextInt();
- System.out.println(x);
- }catch(InputMismatchException e){
- System.out.println("No me diste un valor numerico");
- }finally{
- System.out.println("Se termino la ejecucion del programa");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement