Question: java Write the definition of a new class Date. One object of class Date represent the month, day and year for one date on the

java

Write the definition of a new class Date. One object of class Date represent the month, day and year for one date on the calendar. I have given you the main( ), and you must provide the class definition that will run the given main( ) and print the given output. You only need to define the methods required by this main( ) :

public static void main(String[] args) { Date today; today = new Date( ); today.setMonth(6); today.setDay (25); today.setYear(2018); System.out.println(today); }

will print the output:

6/25/2018

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!