Here you can find the source of addDays(Date d, int n)
public static Date addDays(Date d, int n)
//package com.java2s; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; public class Main { public static Date addDays(Date d, int n) { Calendar c = dateToCalendar(d); c.add(Calendar.DAY_OF_MONTH, n); return c.getTime(); }/*from w w w . jav a 2 s. co m*/ public static Calendar dateToCalendar(Date d) { Calendar c1 = new GregorianCalendar(); c1.setTime(d); return c1; } }