Write a program that asks the user to enter integers. The program adds the numbers entered by the user to the list in the order in which they were entered. When the user enters -1, the program terminates and prints the list. If the user's input contains anything other than numbers, the program ignores the input. Example execution: Give a number: 2 Give a number: 3 Give a number: sdf Give a number: 4 Give a number: 5 Give a number: forty Give a number: -1 [2, 3, 4, 5] import java.util.Random; import java.util.ArrayList; import java.util.Scanner; public class Test{ public static void main(String[] args){ final Random r = new Random(); ArrayList list = new ArrayList<>(); // DONT RECREATE SCANNER EVERY ITERATION Scanner reader = new Scanner(System.in); while (true) { try { System.out.print("Give a number: "); int user_num = Integer.valueOf(reader.nextLine()); // terminate if user enters '-1' if (user_num == -1) { break; } else { list.add(user_num); } } // ignore error and continue if user enters non-integer catch (Exception e) { continue; } } System.out.println(list); } } Test number 1 Give a number: 2 Give a number: 3 Give a number: 4 Give a number: x Give a number: 5 Give a number: -1 [2, 3, 4, 5] Test number 2 Give a number: six Give a number: 10 Give a number: 12 Give a number: asdads Give a number: 14 Give a number: 16q Give a number: we Give a number: -1 [10, 12, 14] Test number 3 Give a number: 9 Give a number: 9 Give a number: nine Give a number: nine Give a number: 9 Give a number: 9 Give a number: 8 Give a number: 7 Give a number: too Give a number: 2 Give a number: f2 Give a number: -1 [9, 9, 9, 9, 8, 7, 2]