// Equals function that checks if 2 months are equal public boolean equals(Months object2) { boolean status; if (name.equals(object2.name) && monthsNumber == object2.monthsNumber) status = true; else status = false; return status; }
// Returns name of month based on the number entered by user public MonthName getMonthName() { return MonthName.values()[monthsNumber - 1]; }