Multiple Choice
It has been suggested the accessor method below be added to the class to return the Date one day later than the given date. public Date getNextDate()
{
If (day == lastDayOfMonth() )
{
Month++;
If (month == 12) { month = 1; }
Day = 1;
}
Else { day++; }
Return this;
}
What is wrong with this design?
A) You cannot return this from a method.
B) It uses lastDayOfMonth, a private method of the class.
C) It has the side effect of changing the Date.
D) Since it returns a Date other than this one, the class is not consistent.
Correct Answer:

Verified
Correct Answer:
Verified
Q8: A new class is proposed to collect
Q11: When are statements in a class-level static
Q34: Which of the following is a true
Q36: Which of the following statements describes a
Q37: Given the following method header, other would
Q38: Which of the following constitutes a common
Q40: Which of the following statements describes an
Q43: Which of the following represents a good
Q44: Which of the following statements is true
Q78: Which of the following would be an