首页 > 解决方案 > 出现奇怪的错误,不知道如何解决

问题描述

尝试制作一堆方法并打印出它们的结果。我认为我所拥有的一切都很好,但是我遇到了一些奇怪的错误,我不知道它们是什么意思。由于某种原因,我什至无法打印出一个简单的“测试”

我已经写出了方法,但我还没有调用它们,因为我什至无法在不终止的情况下让它工作。

System.out.print("Test");
public static double pow(double a, double b){
    return Math.pow(a, b);
} //Use 3.0 and 2.0

public static double sqrt(double x) {
    return Math.sqrt(x);
} //25.0

public static int max(int a, int b) {
    if ( a < b ) {return b;}
    else {return a;}
} //Use 6 and 2

public static double max(double a, double b) {
    if ( a < b ) {return b;}
    else {return a;}
} //Use -50.0 and 7.0

public static double random() {
    return Math.random();
}

我至少想打印测试词。也用于调用时工作的方法。

标签: java

解决方案


推荐阅读