Get integer value of the current year in Java
Using Java 8's time API (assuming you are happy to get the year in your system's default time zone), you could use the Year::now
method:
int year = Year.now().getValue();
This simplest (using Calendar, sorry) is:
int year = Calendar.getInstance().get(Calendar.YEAR);
There is also the new Date and Time API JSR, as well as Joda Time