In Java8's date and time package java.time
, the interface Temporal
is implemented by LocalDate
, LocalTime
, and LocalDateTime
etc. Especially the the LocalDate
and LocalTime
implemented the plus(TemporalAmount amountToAdd)
smartly, say LocalDate and LocalTime use the parameter's method - amountToAdd.addTo to implement the plus method
This seems to make use of some design patterns. Could anyone tell which design pattern is used in the mentioned implementation?
Aucun commentaire:
Enregistrer un commentaire