0 votes
1 view
in Java by (4.1k points)
I need to determine the current year in Java as an integer. I could just use java.util.Date(), but it is deprecated.

1 Answer

0 votes
by (46.1k points)

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

Not certain if this fits with the criteria of not fixing up a new Timeline? (Why the resistance to making so?)

Related questions

Welcome to Intellipaat Community. Get your technical queries answered by top developers !