0 votes
in JAVA by
What distinguishes Period from Duration in Java 8?

1 Answer

0 votes
by

There is a small distinction between Period and Duration, despite the fact that both can be used to compute the distinction between dates in Java. In Java 8, Period is the difference between the two LocalDate values while Length is the difference between the two Instant values. Instead of returning a Duration, the LocalDate till() method returns a Period, which may be used to display a number of days, months, and years that have passed between two dates.

Related questions

+3 votes
asked May 13, 2021 in JAVA by rajeshsharma
0 votes
asked Sep 18, 2021 in JavaScript by sharadyadav1986
...