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螺紋我使用eclipse,並得到這個錯誤有人可以告訴我,我哪裏出錯
異常 「主要」 java.lang.Error的:未解決的問題,編譯:
at reviewDistance.ReviewDistance.main(ReviewDistance.java:6)
在文件頂部的「進口」之前移動「包裝」:) – paulsm4