lots of exercises in java... from https://github.com/exercism/java

example.java 377B

1234567891011121314151617
  1. public class Gigasecond {
  2. private LocalDateTime birthDateTime;
  3. public Gigasecond(LocalDateTime birthDateTime) {
  4. this.birthDateTime = birthDateTime;
  5. }
  6. public Gigasecond(LocalDate birthDate) {
  7. this.birthDateTime = birthDate.atTime(0, 0);
  8. }
  9. public LocalDateTime getDate() {
  10. return birthDateTime.plusSeconds(1000000000);
  11. }
  12. }