Date incrementing constructor won't compile
<p>The program is supposed to prompt a user for a date and it will increment by itself. It's the DateTest class that I'm having trouble with. The error message says "Cannot invoke nextDay() on the array type Date[]"</p>

<p>UPDATED</p>

<p>I got rid of the unnecessary statement. But now I'm getting this error message, </p>

<p>"Error: Main method not found in class Date, please define the main method as:
   public static void main(String[] args)"</p>

<p>Do I have to move the main method anywhere?</p>

<pre><code>import javax.swing.JOptionPane;

public class Date {

    private int month; // 1-12
    private int day; // 1-31 based on month
    private int year; // any year
    int value;

    public Date() {
        month = 1;
        day = 1;
        year = 1900;
    }

    public Date(int m, int d, int y) {
        month = m;
        year = y;
        day = d;
    }

    public String GetDate() {
        String Msg1 = month + "/" + day + "/" + year;
        JOptionPane.showMessageDialog(null, Msg1);
        return Msg1;
    }

    public void setMonth() {
        int value = Integer.parseInt(JOptionPane.showInputDialog("Enter Month:"));

        if (value &gt; 1 &amp;&amp; value &lt; 13) // validate month  
        {
            month = value;
        } // check for leap year  
        else if (month == 2) {
            boolean isleap = true;
            if (year % 4 != 0) {
                isleap = false;
            } else {
                isleap = true;
            }

        } else // month is invalid  
        {
            String Message = "Month" + month + "Month must be 1-12";
            JOptionPane.showMessageDialog(null, Message);
        }
    }

    public void setDay() {
        int value2 = Integer.parseInt(JOptionPane.showInputDialog("Enter Day:"));
        int[] daysPerMonth = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
// check if day in range for month
        if (value2 &gt; 0 &amp;&amp; value2 &lt;= daysPerMonth[month]) {
            day = value2;
        }

        value = value2;
    }

    public void setYear() {
        int value3 = Integer.parseInt(JOptionPane.showInputDialog("Enter Year:"));
        year = value3;
    }

    public int getMonth() {
        return month;
    }

    public int getDay() {
        return day;
    }

    public int getYear() {
        return year;
    }

    public int nextDay() {
        int cDay = day + 1;
        if (value == cDay) {
            day = cDay;
        } else {
            day = 1;
        }
        {
            NextMonth();
        }
        return day;
    }

    public int NextMonth() {
        if (12 == month) {
            year++;
        }
        return month = 1;
    }

    public String toString() {

        return month + "/" + day + "/" + year;

    }

}

class dateTest {

    public static void main(String args[]) {
        Date newDate = new Date(11, 27, 2011);
        final int arraySize = 1;


        {
            for (int i = 0; i &lt; arraySize; i++) {
                newDate.setDay();
                newDate.setMonth();
                newDate.setYear();
            }
            for (int counter = 0; counter &lt; 4; counter++) {

                newDate.nextDay();

                {

                    String Message = "Incremented Date:" + newDate.toString();
                    {
                        JOptionPane.showMessageDialog(null, Message);
                        System.exit(0);

                    }
                }
            }
        }
    }

}
</code></pre>
