Code example for Date

Methods: hashCode

0
		return anotherDate.getDay() == this.getDay() && anotherDate.getMonth() == this.getMonth();
	} 
 
	@Override 
	public int hashCode() { 
		return date.hashCode();
	} 
 
	@Override 
	public boolean equals(Object obj) {
		if (!(obj instanceof OurDate)) 
			return false; 
		OurDate other = (OurDate) obj;
		return other.date.equals(this.date);
	} 
	 
	private int getPartOfDate(int part) {
		GregorianCalendar calendar = new GregorianCalendar();
		calendar.setTime(date);
		return calendar.get(part);
	}