*/
package controller;
import java.util.Scanner;
/**
*
* @author dylan
*/
public class Controller {
public Controller() {
getUserInput();
}// end of controller
private void getUserInput() {
String color = "";
boolean isColor;
Scanner input = new Scanner(System.in);
System.out.println("Please enter a primary color: blue, red, or yellow.");
color = input.nextLine();
do{
if (input.hasNextLine()) {
color = input.nextLine();
isColor = true;
}
else {
System.out.println("Thats not a primary color");
isColor = false;
}
}
while(!(isColor));
System.out.println(color);
}
}// end class
i need to validate string color to only be blue red or yellow but im not exactly sure how to set it to only those colors