fork(2) 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.  
  8. /* Name of the class has to be "Main" only if the class is public. */
  9. class Ideone
  10. {
  11. public static void main (String[] args) throws java.lang.Exception
  12. {
  13. LocalDate
  14. .of( 2000 , Month.JANUARY , 1 )
  15. .datesUntil(
  16. Year.now().plusYears( 1 ).atDay( 1 )
  17. )
  18. .filter(
  19. localDate -> localDate.getMonth().equals( Month.AUGUST )
  20. )
  21. .filter(
  22. localDate -> localDate.getDayOfMonth() == 15
  23. )
  24. .filter(
  25. localDate -> localDate.getDayOfWeek().equals( DayOfWeek.TUESDAY )
  26. )
  27. .map(
  28. localDate -> Year.from( localDate )
  29. )
  30. .forEach(
  31. System.out :: println
  32. );
  33. }
  34. }
Success #stdin #stdout 0.13s 58304KB
stdin
Standard input is empty
stdout
2000
2006
2017
2023