Period.withYears

Returns a copy of this period with the specified amount of years. !(p) This sets the amount of the years unit _in a copy of this period. The months and days units are unaffected. !(p) The months unit is not automatically normalized with the years unit. This means that a period of "15 months" is different to a period of "1 year and 3 months". !(p) This instance is immutable and unaffected by this method call.

@param years the years to represent, may be negative @return a {@code Period} based on this period with the requested years, not null

class Period
withYears
(
int years
)

Meta