Advertisement
WallHero

EjemploCargaLongParse

Aug 20th, 2020
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement