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)
什么情况?