Year now(Clock clock)
creates the current year from the specified clock.
now
has the following syntax.
public static Year now(Clock clock)
The following example shows how to use now
.
import java.time.Clock; import java.time.Year; /*from www .j av a2s .c o m*/ public class Main { public static void main(String[] args) { Year y = Year.now(Clock.systemDefaultZone()); System.out.println(y); } }
The code above generates the following result.