Problem
Given a Date.Add specified number of days to endDate.
Below is the doubleDate function that I need to define.
public static Date doubleDate(Date endDate,int noOFDays){
}
Solution:
public static Date doubleDate(Date endDate,int noOFDays){
Calendar c = Calendar.getInstance();
c.setTime(endDate);
c.add(Calendar.DATE,noOFDays);
return c.getTime();
}
Can anyone guide me which method should I use to double the given endDate?