Year now()
creates the current year from
the system clock in the default time-zone.
now
has the following syntax.
public static Year now()
The following example shows how to use now
.
import java.time.Year; public class Main { public static void main(String[] args) { Year y = Year.now(); System.out.println(y); } }
The code above generates the following result.