fork download
  1. import java.time.LocalDate;
  2.  
  3. public class Main {
  4. public static void main(String[] args) {
  5. // Test
  6. System.out.println(inRange(LocalDate.now()));
  7. System.out.println(inRange(LocalDate.of(2021, 12, 31)));
  8. System.out.println(inRange(LocalDate.of(2022, 2, 20)));
  9. }
  10.  
  11. static boolean inRange(LocalDate date) {
  12. return !date.isAfter(LocalDate.now().plusDays(90));
  13. }
  14. }
Success #stdin #stdout 0.07s 48336KB
stdin
Standard input is empty
stdout
true
false
false