lqtchacha
发贴: 6
积分: 0
|
于 2005-06-12 15:41
请使用准确的文字描述作为标题 Your next post without a proper Subject will be removed.
There should be at most one (i.e. can have none) public class in a .java file and the name of the file MUST match the name of the public class.
package MyPack; public class balance { String name; double bal; public balance(String n,double b) { name=n; bal=b; } public void show() { if(bal<0) System.out.println("-->"); System.out.println(name+":$"+bal); } }
为什么我编译的时候会出现下面的错误? \MyPack.java:2: class balance is public, should be declared in a file named balance.java public class balance ^ 1 error
Process completed.
有什么解决的办法没有?怎样解决?
why edited on 2005-06-12 19:07
|