[英]I am using eclipse and getting this error can someone tell me where I am going wrong
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");
}
}
The error code I recieve is this and I don't know why! 我收到的错误代码是这个,我不知道为什么! I am very new to Java
我是Java的新手
Exception in thread "main" java.lang.Error: Unresolved compilation problem: 线程“主”中的异常java.lang.Error:未解决的编译问题:
at reviewDistance.ReviewDistance.main(ReviewDistance.java:6)
import java.util.Scanner;
package reviewDistance;
change it to 更改为
package reviewDistance;
import java.util.Scanner;
package should be the first line in your jave file 包应该是您的jave文件的第一行
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.