subject

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

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 22:20
Pp 4.1 design and implement a class called sphere that contains instance data that represents the sphere’s diameter. define the sphere constructor to accept and initialize the diameter and include getter and setter methods for the diameter. include methods that calculate and return the volume and surface area of the sphere (see pp 3.5 for the formulas). include a tostring method that returns a one-line description of the sphere. create a driver class called multisphere, whose main method instantiates and updates several sphere objects.
Answers: 1
question
Computers and Technology, 23.06.2019 04:00
In a word processing program, such as microsoft word, which feature to you choose the desired picture enhancement?
Answers: 2
question
Computers and Technology, 23.06.2019 14:00
What is html ? give a small description about html
Answers: 2
question
Computers and Technology, 24.06.2019 09:40
Healthy study habits are best described as
Answers: 1
You know the right answer?
Consider the following code segments for a Date class:

public class Date
{
Questions
Questions on the website: 13722362