一个很弱智的问题,大家帮帮我这只菜鸟
我是在Notepad中编写的小程序:
public class TestEquals {
public static void main(String[] args) {
Cat c1 = new Cat(1,1,1);
Cat c2 = new Cat(1,1,1);
System.out.println(c1 == c2);
System.out.println(c1.equals(c2));
}
}
class Cat {
int color;
int height;
int weight;
public Cat(int color,int height,int weight) {
this.color = color;
this.height = height;
this.weight = weight;
}
}
但使用命令行运行时却出现问题:
Exception in thread "main" java.lang.NoClassDefFoundError:TestEquals
但在eclipse中运行却没问题,这是怎么回事?求人教教我~~~