Q1 / Dose anyone can write this program?
- Create class Date 2. Declare three instance variables: day (int) with default value 01 , month (int) with default value 01, year(int) with default value 2019. 3. Create the default constructor for the class Date and a parameterized constructor to initialize the three instance variables 4. Create a method compare(Date d1, Date d2) to compare two dates 5. Create method toString() to display the date in the following format: day/month/year 6. Create another class called TestDate (it contains the main method): – Create two instances of the class Date, d1 using the default constructor and d2 (day=23, month=10 and year=2019). – Display the dates, d1 and d2 in the format day/month/ year. – Compare the dates d1 and d2 – Create an array entitled Array_Dates of type Date (the length of the array must be given by the user). Initialize each element of the array with a Date object created with default constructor.
No answers yet!
4 years ago by Muqrin