I've been trying to build a java program to display the date in a MM/DD/YYYY format with constructors to link the return data, this is the initial sequence and was wondering about my get and set statement; and their format.

// Date class with a constructor to
// to initialize instance variable to display date.
import java.util.Scanner;

public class Date 
    private int month; // instance variable that stores the month variable
    private int day;// instance variable that stores the day variable
    private int year;// instance variable that stores the year variable

   // constructor displays date in MM/DD/YYYY format   
    public Date(int date) 
        date = displayDate; 
   } // end Date constructor
   // method  to set the date
   public void setMonth(int Month variable)
    month = Month variable;
    public void setDay(int Day variable)
    day = Day variable;
    public void setYear(int Year variable)
    year = Year variable;
    //end method setDate

        //method to retrieve Date
            public int getMonth()
        return month;
    public int getDay()
        return day;
    public int getYear()
        return year;
    // end method getDate

    //display Date
    public void displayDate (date)

    }//end class Date


Good jCoke,

System.out.println(mm + "/" + dd + "/" + yy);

You should at least try to compile this coded and fix any compile errors.

I have worked out most of the bugs, but I keep getting a expected error with the following statement:


What did it expect? (maybe a ; at the end?)