Hello,
I am struggling using the method between(LocalDate startDateInclusive, LocalDate endDateExclusive) from java.time.Period. It keeps highlighting "between" and gives me the syntax error "cannot find symbol-method between(LocalDate startDateInclusive, LocalDate endDateExclusive)".
import java.time.LocalDate; import java.time.Period; public class test { private LocalDate birthdate; public test(LocalDate day) { birthdate = day; } public int getAge() { Period time = between(LocalDate.now(),birthdate); int age = time.getYears(); return age; } }
I hope somebody can help me implement this method correctly.
Thanks in advance
Raf