Computers and Technology

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

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 22:30, jennyrr9021
This isn’t really school related, but like where the heck can you find manga, to read to where you don’t have to pay money, for points? my friend wants me to read bj alex, and i can’t find it anywhere for free.
Answers: 2
image
Computers and Technology, 23.06.2019 06:40, euniceyi56
How many nibbles can be stored in a 16-bit word?
Answers: 1
image
Computers and Technology, 23.06.2019 14:30, officialrogerfp3gf2s
Select the correct answer. a company wants to use online methods to target more customers. it decides to conduct a market research by collecting the data of a few customers with their consent. they want to track data of the sites that their customers frequently visit. which software can the company? a. spyware b. bots c. adware d. trojan horse e. rootkits
Answers: 1
image
Computers and Technology, 23.06.2019 20:00, shaheedbrown06
What software programs are used to to create professional publication? a.) graphics programs b.) word processors c.) page layout programs d.) spreadsheet programs
Answers: 2
Do you know the correct answer?
Consider the following code segments for a Date class:

public class Date
{

Questions in other subjects:

Konu
Mathematics, 16.02.2021 07:30
Konu
Mathematics, 16.02.2021 07:30
Konu
Biology, 16.02.2021 07:30
Konu
Arts, 16.02.2021 07:30