Ok so im trying to make it so if the person does not want to enter their age the program will print out a different answer. However, when i do this it gives me an error for the string. I used // to make it so the int answer wasnt being played and it worked then. How exactly would I make it so they both work for the same question? I searched for an answer but I couldnt seem to find it so if there is a link for this please link me. Thanks!
System.out.println("So how old are you?");
TimeUnit.SECONDS.sleep(2);
System.out.println("If you dont want to answer you dont have to. ");
Scanner scan4 = new Scanner (System.in);
String user_imput_string1 = scan.nextLine();
if (user_imput_string1.equals("I dont know")) {
System.out.println("Ah thats cool. You look great regardless of your age anyway");
} else {
System.out.println("Ah thats cool. You look great regardless of your age anyway");
}