Question: Write a class called Date that represents a date consisting of a year, month, and day. A Date object should have the following methods: //
Write a class called Date that represents a date consisting of a year, month, and day. A Date object should have the following methods:
// Constructs a new Date object to represent the given date.
public Date(int y, int m, int d)
// Constructs a Date object with year 1970, month 1 (January), and day 1.
public Date()
// Returns a String representation of the Date object such as: 7/22/1970
public String toString()
// Include accessor and mutator methods for all of the fields.
Write in Java and a at a simple level
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
