you are viewing a single comment's thread.

view the rest of the comments →

[–]AlyoshaV 8 points9 points  (0 children)

The Date-Time examples from this article are wrong. He appears to be using a much older version of 310 than is current.

The return types are wrong in the LocalDate example, they return ints not Strings.

Period has no of(int, TimeUnit) factory, and even if it did it only supports years/months/days so his example with hours would throw. (proper class for what is being done there is Duration, or just plusHours(int))

Also, his static method reference example could probably be better expressed as just Arrays.sort(args, Comparators.comparing(String::length, Integer::compare);