package Game;
import java.util.Scanner;
public class practice {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
String jack = "good, how are you?";
System.out.println("Hello, my name is Julie the Robot");
try{
Thread.sleep(1000);
}catch(InterruptedException ex) {
Thread.currentThread().interrupt();
}
System.out.println("How Are You?");
if (jack.equals(sc.nextLine())); {
System.out.println("Im Doing Great!");
}
// this code is giving me an error
else if (!jack.equals(sc.nextLine()));{
System.out.println("Oh! So you dont care about me eh?");
}
try{
Thread.sleep(700);
}catch(InterruptedException ex) {
Thread.currentThread().interrupt();
}
System.out.print("...");
try{
Thread.sleep(200);
}catch(InterruptedException ex1) {
Thread.currentThread().interrupt();
}
System.out.print("And Yes, I'm A Canadian");
}
}
我正在尝试运行这段代码,但它突出显示了 else if 部分,而不是让我运行它。它出什么问题了?