Q:

Using answer in if

I ran into this problem. This is my code:
String answer;

System.out.println("Choose a day");
answer = tastatur.nextLine();

if(svar.equals("saturday"))
  System.out.println("Saturday");

I want to use the answer in the if statement. 

A:

You are looking at the wrong variable.  
if( answer.equals("saturday") ){
   System.out.println("Saturday")
}  

What's the logic?
You are reading what the user is entering into the answer variable. In your code you are checking the svar variable while you should be checking the answer variable. If indeed the user entered Saturday, you will print it on the screen. Else, not.  
equalsIgnoreCase() is a better method to use because Saturday and saturday are different in the sense that one has a capitalized S and the other does not. equals() will treat them as different.  
You have said that Java is new to you. I hope you are initializing the tastatur variable properly as:  
BufferedReader tastatur = new BufferedReader(new InputStreamReader(System.in));  

and using the import java.io.* in your program.  

As an aside, please read the official tutorials provided by Java. They are a good resource. Ask questions on StackOverflow when you have run out of luck while looking for answers yourself. With that said, welcome to StackOverflow where we very mercilessly close questions if they do not meet our standards or contain spam.

