Why doesn't this program work
<p>I have been asked to code a program (class) based on some certain instructions. I feel like I ALMOST got it down, but am doing something stupid. I cannot figure out how to add a hyphen into a symbolic constant so that when I type INSERT_HYPHEN it will insert a "-" into a accessors method. It says incompatible types>:(  Also when I try to insert the local variable "fullDate" into the 'getFullDate' accessor method, and then put "fullDate = year + month + day" it indicates 'incompatible types! Perhaps it is because the accesor method is a string, and I am trying to add 'ints' inside it. I cannot find a way around it. Here is my code.</p>

<pre><code>public class Date
{
public static final int INSERT_ZERO = 0;
public static final char INSET_HYPHEN = -;   //ERROR incompatible types

// instance variables - replace the example below with your own
private int year;
private int month;
private int day;

/**
 * Default constructor
 */
public Date()
{
    setYear (2013);
    setMonth (01);
    setDay (01);
}

/**
 * 
 */
public Date (int whatIsYear, int whatIsMonth, int whatIsDay)
{
    setYear (whatIsYear);
    setMonth (whatIsMonth);
    setDay (whatIsDay);
}

/**
 *@return year
 */
public int getYear()
{
    return year;
}

/**
 *@return month
 */
public int getMonth()
{
    return month;
}

/**
 *@return day
 */
public int getDay()
{
    return day;
}

/**
 *@return 
 */
public String getFullDate()
{
    String fullDate;
    if (whatIsMonth &lt; 10);    // the year, month, and day all give me incompatible types :(
    {
        fullDate = year + INSERT_HYPHEN + INSERT_ZERO + month + INSERT_HYPHEN +  day; 
    }
    if (whatIsDay &lt; 10);
    {
        fullDate = year + INSERT_HYPHEN +  month + INSERT_HYPHEN +  INSERT_ZERO + day;
    }
    else
    {
        fullDate = year + INSERT_HYPHEN + month + INSERT_HYPHEN + day;
    }
    return year + month + day;
}

/**
 * 
 */
public void setYear (int whatIsYear)
{
    if ((whatIsYear &gt;= 1990) &amp;&amp; (whatIsYear &lt;= 2013))
    {
        year = whatIsYear;
    }
    else
    {
        year = 2013;
    }
}

/**
 * 
 */
public void setMonth (int whatIsMonth)
{
    if ((whatIsMonth &gt;=  1) &amp;&amp; (whatIsMonth &lt;= 12))
    {
        month = whatIsMonth;
    }
    else
    {
        month = 01;
    }
}

/**
 * 
 */
public void setDay (int whatIsDay)
{
    if ((whatIsDay &gt;= 1) &amp;&amp; (whatIsDay &lt;= 31))
    {
        day = whatIsDay;
    }
    else
    {
        day = 01;
    }
}
</code></pre>

<p>}</p>

<p>Just for some more background. This class that I am constructing has three fields, to hold year, month and day. Years can be between 1900 and the current year, inclusive. Months can be between 1 and 12
inclusive. Days can be between 1 and 31 inclusive. I have to use symbolic constants instead of “magic” numbers in the code, e.g. public static final int FIRST_MONTH = 1;</p>

<p>The default constructor sets year to the current year, month to the first month and day to the first day. The non-default constructor tests each parameter. If the year parameter is outside the acceptable range, it sets the field to the current year. If the month parameter is outside the acceptable range, it sets the field to the first month. If the day parameter is outside the acceptable range, it sets the field to the first day.</p>

<p>Each field has an accessor method and a mutator method. All three mutator methods check their parameter for validity, and if not valid set the corresponding field in the same way as the nondefault
constructor.</p>

<p>This is the part that I am having trouble with. I have to include a method called "public String getFullDate() which returns a string with the date in this format: YYYY-MM-DD e.g. 2012-01-01. Month and day with a single digit are padded with a leading zero." </p>

<p>Any help whatsoever would be appreciated, even if just an idea :) Thanks.</p>
