Question: . package ch01.dates; public class IncDate extends Date { public IncDate(int newMonth, int newDay, int newYear) { super(newMonth, newDay, newYear); } public void increment() //

.

package ch01.dates;

public class IncDate extends Date {

public IncDate(int newMonth, int newDay, int newYear) { super(newMonth, newDay, newYear); }

public void increment() // Increments this IncDate to represent the next day. { // increment algorithm goes here day++; } }

_________________________________________________________

Assume that date1 and date2 are objects of class IncDate as defined in section1.2(code above), what would be the output of the following code?

Date1= new incdate (5,5,2000);

Date2 = date 1;

System.out.println(date1);

System.out.println(date2);

Date1.increment();

System.out.println(date1);

System.out.println(date1);

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 Databases Questions!