Get integer value of the current year in Java

int year = Calendar.getInstance().get(Calendar.YEAR);

Not sure if this meets with the criteria of not setting up a new Calendar? (Why the opposition to doing so?)

Leave a Comment