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
Get step-by-step solutions from verified subject matter experts
