[求助]JCREATOR 编译出错
下面的例子用JCREATOR运行后显示illegal start of expression和';' expectedpublic class MyKey {
private String name = null;
private int age = 0;
/**
* Method equals
*
*
* @param obj
*
* @return
*
*/
public boolean equals(Object obj) {
// TODO: Add your code here
if(obj instanceof MyKey)
{
MyKey objTemp = (MyKey)obj;
if(name.equals(objTemp.name) && age==objTemp.age)
{
return true;
}
else
{
return false;
}
}
/**
* Method hashCode;
*
*
* @return
*
*/
public int hashCode() {
// TODO: Add your code here
return name.hashCode() + age;
}
}
}