fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6. import java.time.*;
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main(String[]args){
  11. Scanner sc = new Scanner(System.in);
  12. LocalDate nextDate = nextDate(sc.nextInt());
  13. System.out.println(nextDate);
  14. }
  15.  
  16. private static LocalDate nextDate(int daysToAdd){
  17. LocalDate today = LocalDate.now();
  18. today = today.plusDays(daysToAdd);
  19. return today;
  20. }
  21.  
  22. private static LocalDate nextDateInline(){
  23. return LocalDate.now().plusDays(int daysToAdd);
  24. }
  25.  
  26.  
  27.  
  28. }
Success #stdin #stdout 0.22s 35388KB
stdin
10
stdout
2018-07-20