New course! Every coder should learn Generative AI!
Try a free lesson0
yes, you must use scanner, import it, then put this:
if (playerAnswer.equalsIgnoreCase("apples "){
//put your code here (System.out.println(" ");
/***you dont have to put player answer as your variable, you can have what ever you want as long as you declared it first***/
/***or you can make stats for each fruit in another class, then call them in your other class***/
}
//hope that helped :)