Example usage for java.time Year with

List of usage examples for java.time Year with

Introduction

In this page you can find the example usage for java.time Year with.

Prototype

@Override
public Year with(TemporalField field, long newValue) 

Source Link

Document

Returns a copy of this year with the specified field set to a new value.

Usage

From source file:Main.java

public static void main(String[] args) {
    Year y = Year.of(2014);
    Year l = y.with(ChronoField.YEAR, 2013);
    System.out.println(l);//from ww  w  . j a  v  a 2s. co m

}