java Math abs和ceil输出编译错误
我需要帮助。我试着用数学课来计算一些数字。我可以编译代码,但从来没有得到输出。我正在使用Jcreator编译器。任何人都知道我的代码出了什么问题。谢谢你的意见 这是我的密码
public class Exercise607
{
public static void main (String[] args)
{
double x=7.5;
double xx;
System.out.printf("the absolute value of x is %.2f\n", xx(x));
}
public static double xx( double x )
{
return Math.abs(x);
}
}
# 1 楼答案
您的本地
double xx
从未被使用过。此外,格式String
只包含一个浮动说明符。我想你想要输出是