我正在使用日食,收到此错误有人可以告诉我哪里出错了

  • 本文关键字:错了 出错 错误 java eclipse
  • 更新时间 :
  • 英文 :

import java.util.Scanner;
package reviewDistance;
public class ReviewDistance {
    public static void main(String[] args) {
        int sec1;
        int sec2;
        int sec3;
        int race;
        Scanner input = new Scanner(System.in);
        System.out.print("Enter the length of the first section of the race in kilometers:");
        sec1 = input.nextInt();
        System.out.print("Enter the length of the second section of the race in kilometers:");
        sec2 = input.nextInt();
        System.out.print("Enter the length of the third section of the race in kilometers:");;
        sec3 = input.nextInt();
        input.close();
        race = sec1 + sec2 + sec3;
        System.out.println("Length of the race: " + race + "km");
    }
}

我收到的错误代码是这个,我不知道为什么!我对Java很陌生

线程"main"java.lang 中的异常:未解决的编译问题:

at reviewDistance.ReviewDistance.main(ReviewDistance.java:6)
import java.util.Scanner;
package reviewDistance;

将其更改为

package reviewDistance;
import java.util.Scanner;

包应该是 jave 文件中的第一行

最新更新