日期:2014-05-20  浏览次数:20592 次

这代码怎么编译不过去
import java.lang.*;

class Employee
{
public boolean equals(Object other)
{
if( this.getClass() != other.getClass() )
{
System.out.println("不是同一个类");
return false;
}
else
{
System.out.println("是同一个类");
return true;
}
}
}
class Manager extends Employee
{
}
public class Empty
{
public static void main(String[]args)
{
Employee e1 = new Employee();
Manager e3 = new Manager();

e1.equals(e2);//提示这行有问题
}
}

------解决方案--------------------
e2是什么?
------解决方案--------------------
e2没有定义呀,估计你是要写e3吧!
------解决方案--------------------
e2写错了吧!