I'm trying to create a calendar class in which I initial a default date. When a user creates the class the default Constructor is assigning the value "01-01-2012". If the user enters a valid date as a string parameter the second constructor will assign the new date.If not I would like the class to give a friendly warning this is not a valid date and go ahead and keep the default assignment.( eg. If the user enter "02/31/2012". This would throw the warning and go ahead and create the instance while setting the default to "01-01-2021".) I also created a method to set the date so this can be changed later once they give a valid date. How should i the second constructor in order to do this? Or is there a better more efficient process in order to do this?
import java.time.*;
import java.time.format.DateTimeFormatter;
public class CalendarDate {
    private String date;
    private DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MMMMM dd uuuu");
  
    //constructor sets date to January 1, 2012
    CalendarDate(){
       date = "01-01-2012";
    };
    /**
     *  Initializes object's chosen date
     * 
     * @param day - initializes day
     * @param month - initialazes month
     * @param year - initialazes year
     */
    public CalendarDate(String date){
        this.date = date;
    } // 1 - parameter Constructor
    /**
     * 
     *  Sets new date given to this object
     * 
     * @param date sets new date to object
     */
    public void setDate(String date){
        this.date = date;
    }
    /**
     * 
     * Returns objects set date.
     * 
     * @return Returns set date.
     */
    public String getDate(){
        LocalDate getDate = LocalDate.parse(date);
        String formattedDate = getDate.format(formatter);
        return formattedDate;
    }
    /**
     * 
     * Returns object's date
     * 
     * @return Returns object's date
     */
    public String getNextDate(){
        LocalDate dateTime = LocalDate.parse(date);
        LocalDate returnValue = dateTime.plusDays(1);
        String newNextDate = formatter.format(returnValue);
        return newNextDate;
     
    }
    /**
     *  Returns prior date from the object's given date.
     * 
     * @return
     */
    public String getPriorDate(){
        return " ";
    
    }
    /**
     *  Returns the day of the week from the object's given date.
     * 
     * @return
     */
    public String getDayOfWeek(){
        return " ";
    
    }
}
public class Calendar extends CalendarDate{
    public static void main(String[] args){
        CalendarDate testDate = new CalendarDate("06-07-1992");
       testDate.getDate();
        
    }
}
This is what I have so far and I'm wanting to use LocalDate and DateTimeFormatter. Anything will help.
 
     
    