So I have a code
which has String "Stream" as it's main point
which has a code which means "Press 1 for science, 2 for arts,3 for others"
It works fine when user select 1 or 2 but when they select 3 even though I set a scanner inside it that condition too it isn't being executed
here is the code
public class demo{
Scanner input = new Scanner(System.in);
String Stream;
public void Inputstream()  {
	System.out.println("Enter the Stream.");
	System.out.println("1 for Science, 2 for Arts, 3 for others");
	int answer=input.nextInt();
	if (answer==1) {
		answer=input.nextInt();
	}
if(answer==2) {
	Stream="Arts";
}
if(answer!=2|| answer!=1) {
	System.out.println("enter the subject");
	Stream=input.nextLine();
}
}
I got it all I needed to do was write input.next beofre making the scannertake anotherinput