This is just something im trying out, i just recently started coding in java would like some help. Would like to ask user to pick their favorite movie, then take their input and use if statements to give different responses to each response.
import java.util.Scanner;
public class miniFFF {
public static void main (String[]p) {
System.out.println("What is your favourite movie? pick from the answers below:");
System.out.println("a");
System.out.println("b");
System.out.println("c");
System.out.println("d");
System.out.println("e");
answer();
//ifStatements();
System.exit(0);
}
public static String answer() {
String favMovie;
Scanner test = new Scanner(System.in);
favMovie = test.next();
if(favMovie == "a") {
System.out.println("1234");
}
else if (favMovie == "b") {
System.out.println("123");
}
return favMovie;
}
}