I have a problem with my try/catch statement. I know it's probably an easy fix but I'm new to java. Here I want the console to prompt the user to add their initial deposit, for example, if I input something like "hello" the program will crash rather than ask again? thanks
System.out.println("Please enter an initial deposit:");
try{
deposit.add(keyboard.nextInt());
}catch(NumberFormatException e){
System.out.println("Invalid input");
System.out.println("Please enter an account number:");
accountNumber.add(keyboard.nextDouble());
