I need to determine the current year in Java as an integer. I could just use java.util.Date(), but it is deprecated.
java.util.Date()
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?)
1.4m articles
1.4m replys
5 comments
57.0k users