Consider the following code segments for a Date class:
public class Date
{
private int month;
private int day;
private int year;
public Date( int m, int d, int y ) { ... }
public Date( Date dt ) { / ... missing code ... / }
public String getDate() { ... } // returns date in m/d/y format
public int getMonth() { ... } // returns month
public int getDay() { ... } // returns day
public int getYear() { ... } // returns year
public void setDate( int m, int d, int y ) { ... } // sets date
}
Which of the following code segments correctly implements the missing code for the second constructor?
I. setDate( dt. getMonth(), dt. getDay(), dt. getYear() );
II. month = dt. getMonth();
day = dt. getDay();
year = dt. getYear();
III. month = dt. month;
day = dt. day;
year = dt. year; Select one:
A. I only
B. II only
C. III only
D. I and II only
E. I and III only
F. I, II, and III