In the userInput function in Java has the person type in anything, is there anyway I could limit that to 2 options. Here is my code
import java.util.Scanner;
public class Intelijence {
public static void main(String[] args) throws InterruptedException {
Scanner playerInput;
playerInput = new Scanner(System.in);
String Question1;
System.out.println("Ugh, I need some coffee");
Thread.sleep(1000);
System.out.println("'What kind of coffee should he drink'");
Question1 = playerInput.nextLine();
System.out.println(Question1);
}
}
So how can I set the option to something like light or dark roast?