📄 cat.java
字号:
import java.util.Date;
public class Cat {
private String name;
private Date birthday;
public Cat() {
}
public void setName(String name) { this.name = name; }
public String getName() { return name; }
public void setBirthday(Date birthday) { this.birthday = birthday; }
public Date getBirthday() { return birthday; }
public boolean equals(Object other) {
if (this == other)
return true;
if (!(other instanceof Cat))
return false;
final Cat cat = (Cat) other;
if (!getName().equals(cat.getName()))
return false;
if (!getBirthday().equals(cat.getBirthday()))
return false;
return true;
}
public int hashCode() {
int result = getName().hashCode();
result = 29 * result + getBirthday().hashCode();
return result;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -