我是第一次学习Java。我写了一个简单的程序:
public class Solver {
public static void main(String[] args) {
double angle = 1.5;
double height = Math.sin(angle);
System.out.print("The sine of " + angle + " is: ");
System.out.println(height);
}
}
当我尝试编译它时,我在终端中收到以下错误:
Solver.java:4: cannot access Math
bad class file: ./Math.java
file does not contain class Math
Please remove or make sure it appears in the correct subdirectory of the classpath.
double height = Math.sin(angle);
^
1 error
为什么我无法访问数学课程?