// Arup Guha
// 3/22/2026
// Example illustrating ArrayList and StringTokenizer
// Date class used for Age sorting example.

import java.util.*;

public class Date implements Comparable<Date> {

	private int year; 
	private int month;
	private int day;

	// Basic constructor.
	public Date(int yr, int mon, int dy) {
		year = yr;
		month = mon;
		day = dy;
	}
	
	public int compareTo(Date other) {
	
		// Check years.
		int tmp = this.year - other.year;
		if (tmp != 0) return tmp;
		
		// Then months.
		tmp = this.month - other.month;
		if (tmp != 0) return tmp;
		
		// If we get here, this is the final answer!
		return this.day - other.day;
	}
}