我试图在我的程序中运行 TTest,但导入导入它所需的类不起作用。
这是我听说这个类(class)的地方 http://commons.apache.org/proper/commons-math/apidocs/index.html?org/apache/commons/math3/stat/inference/TTest.html
我尝试过:
import java.lang.Object.org.apache.commons.math3.stat.inference.TTest;
和
import org.apache.commons.math3.stat.inference.TTest;
以及一些不起作用的组合。
如果你知道怎么做,请告诉我!
在里面我正在构建使用
TTest test = new TTest();
所以如果这是错误,请告诉我!
最佳答案
import org.apache.commons.math3.stat.inference.TTest;
是导入 TTest
的正确方法来自 commons-math 的类(class).
由于TTest
属于外部库(commons-math
),您必须下载它并告诉Java在哪里可以找到它来构建和运行您的程序,这是类路径,如果您使用的类不属于默认的标准 Java 类,则应该定义它。如果您不了解 Java 中的类路径和外部库,那么您绝对应该 read and google about the subject .
关于java - 导入问题 Java TTest,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17765930/