
Write a Program to add given number of days to the current system date and display the same?

Java add days to date
import java.util.*;
public class AddDaysToDate {
public static void main(String[] args) {
Date date=new Date();
Calendar cal = Calendar.getInstance();
cal.setTime(date);
System.out.println("Today : " + cal.getTime());
cal.add(Calendar.DATE, 10);
System.out.println("After 10 days: " + cal.getTime());
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.