[求助]对着书抄Java代码也能错误!~~简单
public class Compare {public static void main (String args [])
{
double num1=23.4,
num2=35.1;
if (num1>=num2)
System.out.println (num1+">+"+num2);
else
System.out.println (num2+">+"+num1);
}
}
对着书上抄的,检查三次了没抄错! 可就 编译不通过! 错误信息如下:
D:\XX>javac no3.java
no3.java:1: class Compare is public, should be declared in a file named Compare.
java
public class Compare {
^
1 error