gpt4 book ai didi

java - 为什么它总是给我一个系统包错误?

转载 作者:行者123 更新时间:2023-12-02 01:20:16 24 4
gpt4 key购买 nike

我不断收到错误,Java 没有为该文件创建 .class 文件,而是在命令提示符下给出错误

public class TotalAndAverage {
public static void main (String[] arg) {
final int count = 6;
double score0 = 98.05;
double score1 = 100.00;
double score2 = 80.50;
double score3 = 62.65;
double score4 = 77.25;
double score5 = 90.93;
double total = score0 + score1 + score2 + score3 + score4 + score5;
double average = total/count;
int averageInt = (int)average;
int average2Digit = (int)(average * 100) - averageInt *100;

System.out.println("Total Score is: \t" + total);
System.out.println("Average is \t" + average);
system.out.println("Average Score is: \t" + averageInt + "." + average2Digit);
}
}

显示

error: package system does not exist

最佳答案

最后一行应该是

System.out.println(.....) 

不是系统

关于java - 为什么它总是给我一个系统包错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57799266/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com