posted 7 years ago
I am trying to compile code on Java 8 version still giving compiled time error
Period period = Period.ofMonths(1); // create a period
^
symbol: method ofMonths(int)
location: class Period
Period_demo.java:16: error: no suitable method found for plus(Period)
upTo = upTo.plus(period); // adds the period
^
method Temporal.plus(TemporalAmount) is not applicable
(argument mismatch; Period cannot be converted to TemporalAmount)
method ChronoLocalDate.plus(TemporalAmount) is not applicable
(argument mismatch; Period cannot be converted to TemporalAmount)
method LocalDate.plus(TemporalAmount) is not applicable
(argument mismatch; Period cannot be converted to TemporalAmount)
Note: Some messages have been simplified; recompile with -Xdiags:verbose to ge
full output