嗨,我想知道我的代码有什么问题,我得到了标题中所述的错误。这有什么问题?提前致谢。为什么我需要这么多细节,我觉得我已经描述得很好了。
import java.util.Scanner;
public class CombinationLock
{
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
System.out.print("Please enter three uppercase letters.");
System.out.println("Hit enter after each letter.");
String str1 = in.nextLine();
String str2 = in.nextLine();
String str3 = in.nextLine();
System.out.println("Would you like to open the lock?");
if(Yes)
Scanner lol = new Scanner(System.in);
System.out.print("Please enter the combination for this lock.");
System.out.println("Hit enter after each letter");
String str4 = lol.nextLine();
String str5 = lol.nextLine();
String str6 = lol.nextLine();
if(str4.equals(str1))
if (str5.equals(str2))
if(str6.equals(str3))
System.out.println("Congratulations you have unlocked the lock :)");
else
System.out.println("Sorry the combination you have input is not correct :/");
else
System.out.println("Sorry the combination you have input is not correct :/");
else
System.out.println("Sorry the combination you have input is not correct :/");
else
System.out.println("This lock has been locked enter code here with the letters that you have just input.");
}
}