请问,Unresolved compilation problem:
新学JAVA,抄书的一段代码提示:Exception in thread "main" java.lang.Error: Unresolved compilation problem:
at test.Welcome.main(Welcome.java:5)
网络上搜过了,说可能是环境变量问题,可是在dos中可以正确的查看java的版本啊
用的是eclipse
请问这该怎么解决?
程序代码:package test;
import javax.swing.JOptionPane;
public class Welcome {
public static void main(String[] args){
Count myCount=new Count();
int times=0;
// for(int i=0; i<100; i++)
increment(myCount,times);
System.out.println("count is"+myCount.count);
System.out.println("times is"+times);
}
public static void increment(Count c, int times){
c.count++;
times++;
}
}
class Count{
public int count;
Count(int c){
count=c;
}
Count(){
count=1;
}
}[ 本帖最后由 yudeyinji198 于 2014-9-26 13:47 编辑 ]









