Alright so I've been learning Java for almost three days at this point, so I recognize that this is going to sound stupidly simple to most of you. However, I decided to test out what I've learned so far by making a Quiz program. I'm using a scanner to acquire the inputs (the answers to the quiz questions), and comparing the input to a internal String variable (correct1). I keep getting an error in line 8 that says "Scanner and String are incomparable." Why is this so? My code seems to follow a pretty logical, basic progression. Is there another way that I should go about programming this? If so, can you explain why my current syntax doesn't work (so I can learn for next time)? Thanks!
import java.util.Scanner;
class Quiz {
public static void main(String[]arguements) {
System.out.println("Who was the first president of the United States?");
String correct1 = "George_Washington";
Scanner Answer = new Scanner(System.in);
if (Answer == correct1) {
System.out.println("Correct, great job!");}
else{ System.out.println("Wrong, better luck next time.");
}
}
}