I'm trying to make a program to ask French words to myself. I've done this code, but whatever I put in, "Your answer is incorrect." (else condition). Help please.
import java.util.Scanner;
public class AprenderPalabras {
public static void main(String[] args) {
Scanner wordL= new Scanner(System.in);
Scanner wordR = new Scanner(System.in);
Scanner answer= new Scanner(System.in);
String wordL1= wordL.nextLine();
String wordR1= wordR.nextLine();
System.out.println(wordL1 + " -> ");
String answer1= answer.nextLine();
if (answer1==wordR1){
System.out.println("Your answer is correct.");
}
else {
System.out.println("Your answer is incorrect.");
}
}
}