我正在尝试在 Eclipse IDE 中使用 Apache Commons Math (3.5) 库。我已下载 JAR 文件并将库正确添加到我的项目中。
然而,当我实际尝试使用 Apache Commons 库中的类时,我的问题就出现了。我尝试创建一个“描述性统计”类的新实例,如下所示 DescriptiveStatistics stats = new DescriptiveStatistics();
我在该行读取错误:DescriptiveStatistics cannot be resolved to a type
。我还缺少另一个步骤吗?我对使用 Apache Commons 类还很陌生。
最佳答案
可能很简单,您还没有导入 DescriptiveStatistics
类。把这个放在你的文件的顶部:
import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics;
关于java - 使用 Apache Commons 数学所需的指导,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30883702/