Java Loops II

  • + 1 comment

    Calendar class is buggy, and it is a shame that Oracle documentation does not mention that... The DayOfWeek is 3 days off for example, so instead of WEDNESDAY it would show SUNDAY. Use Java8 LocalDate class as per cmveal's comment: return LocalDate.of(year, month, day).getDayOfWeek().name();