Exemplo n.º 1
0
  // 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;
  }
Exemplo n.º 2
0
 // Returns name of month based on the number entered by user
 public MonthName getMonthName() {
   return MonthName.values()[monthsNumber - 1];
 }