Question: I need help with the following Java exercise: Assume that date1 and date2 are objects of class IncDate. What would be the output of the

I need help with the following Java exercise:

Assume that date1 and date2 are objects of class IncDate. What would be the output of the following code?

date1 = new IncDate(5, 5, 2000);

date2 = date1;

System.out.println(date1);

System.out.println(date2);

date1.increment();

System.out.println(date1);

System.out.println(date2);

public class IncDate extends Date

{

public IncDate(int newMonth, int newDay, int newYear)

{

super(newMonth, newDay, newYear);

}

public void increment()

{

}

}

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!