Try-catch creates infinite loop [duplicate]
问题 This question already has answers here : Endless while loop problem with try/catch (2 answers) Closed 5 years ago . I need to be able to take user input until the input is greater than the initial price, but I also need to make it robust so that the user can't break the program by entering something other than a double/integer. If the user does enter something other than a double/int. The problem is that it creates a loop and repeats "Please enter valid currency" + "Please enter: price"