Question: Consider a Day class that models a calendar day such as February 2 8 , 1 9 0 0 . A difficulty is that

Consider a Day class that models a calendar day such as "February 28,1900". A difficulty is that sometimes February has 28 days, and sometimes 29(when the year is a "leap year").
A tester program contains these lines of code:
Day someDay = new Day(1900,2,28); Day nextDay = someDay.addDays(1); System.out.println(nextDay.getMonth()); System.out.println("Expected: 3");
The output is
2 Expected: 3
What does that mean?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!