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, 23.06.2019 02:00
Which of the following is not a source of sustainable raw materials? a) coal mine b) flick of sheep c) cotton plantation d) line forest.
Answers: 2
question
Computers and Technology, 23.06.2019 07:00
You need a quick answer from a coworker. the most effective way to reach your coworker is through a. cloud server b. instant message c. teleconference d. telepresence
Answers: 1
question
Computers and Technology, 23.06.2019 17:30
When making changes to optimize part of a processor, it is often the case that speeding up one type of instruction comes at the cost of slowing down something else. for example, if we put in a complicated fast floating-point unit, that takes space, and something might have to be moved farther away from the middle to accommodate it, adding an extra cycle in delay to reach that unit. the basic amdahl's law equation does not take into account this trade-off. a. if the new fast floating-point unit speeds up floating-point operations by, on average, 2ă—, and floating-point operations take 20% of the original program's execution time, what is the overall speedup (ignoring the penalty to any other instructions)? b. now assume that speeding up the floating-point unit slowed down data cache accesses, resulting in a 1.5ă— slowdown (or 2/3 speedup). data cache accesses consume 10% of the execution time. what is the overall speedup now? c. after implementing the new floating-point operations, what percentage of execution time is spent on floating-point operations? what percentage is spent on data cache accesses?
Answers: 2
question
Computers and Technology, 23.06.2019 18:30
Where can page numbers appear? check all that apply. in the header inside tables in the footer at the bottom of columns at the top of columns
Answers: 1
You know the right answer?
Consider the following code segments for a Date class:

public class Date
{
Questions
question
Geography, 06.10.2020 19:01
question
Mathematics, 06.10.2020 19:01
question
Mathematics, 06.10.2020 19:01
question
Mathematics, 06.10.2020 19:01
question
Mathematics, 06.10.2020 19:01
question
Biology, 06.10.2020 19:01
Questions on the website: 13722361