Java Scanner String to int

Scanner scanner = new Scanner(System.in);
    while (true) {
        String input = scanner.next();
            try {
                int a = Integer.parseInt(input);
                if (a == 0) {
                    break;
                }
                System.out.println(Integer.parseInt(input) * 10);
            } catch (NumberFormatException e) {
                System.out.println("Invalid user input: " + input);
            }
        }
Magnificent Monkey Adi