首页 新闻 会员 周边 捐助

有一段JAVA代码:

0
[已关闭问题] 关闭于 2017-04-13 16:10
复制代码
class Number{
    int i=1;
}

public class Assignment {

    public static void main(String[] args) {
        Number n1=new Number();
        Number n2=new Number();
        Number n3=new Number();
        n1.i=9;
        n2.i=47;
        System.out.println("1:n1.i:"+n1.i+",n2.i:"+n2.i);
        n1=n2;
        System.out.println("2:n1.i:"+n1.i+",n2.i:"+n2.i);
        n1.i=27;
        System.out.println("3:n1.i:"+n1.i+",n2.i:"+n2.i);

    }

}
复制代码

为什么这段代码在IDEA里面运行没问题,但是在eclipse里面就报错?

错误提示:

Exception in thread "main" java.lang.Error: Unresolved compilation problem:
Numer cannot be resolved to a type

at ch03.Assignment.main(Assignment.java:10)

 

什么情况?

JaneEyreWork的主页 JaneEyreWork | 初学一级 | 园豆:11
提问于:2017-04-13 15:52
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册