WallHero

EjemploCargaLongParse

Aug 20th, 2020
81
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2.  
  3. public class EjemploCargaLong {
  4.  
  5. static Scanner scanner = new Scanner(System.in);
  6.  
  7. public static void main(String[] args) {
  8.  
  9.  
  10. try
  11. {
  12. long n = scanner.nextLong();
  13. System.out.println("Se cargó " + n);
  14. }
  15. catch (Exception e) {
  16. System.out.println("Se introdujo un número inválido, reintente.");
  17. main(args);
  18. }
  19.  
  20. }
  21. }
RAW Paste Data