|
我刚学java现在一段代码:
public class MathCalc
{
public static void main(string[]args)
{
//calculate the radius of a circle
//which has an area of 100 square feet
double radius = 0.0;
double circleArea = 100.0;
int feet = 0;
int inches = 0;
radius = Math.sqrt(circleArea/Math.PI);
feet = (int)Math.floor(radius); // Get the whole feet and nothing
// but the feet
inches = (int)Math.round(12.0*(radius = feet));
System.out.println("The radius of a circle with area " +
circleArea + " square feet in\n " +
feet + " feet " + inches + "inches");
}
}
大概有什么问题可以指教下吗???它出现了这样的问题(除了这个还有其他吗)
类 MathCalc 是公共的,应在名为 MathCalc.java 的文件中声明
public class MathCalc |
|