Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (4k 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 (46k 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

0 votes
1 answer
0 votes
1 answer
asked Nov 24, 2019 in Java by Anvi (10.2k points)

Browse Categories

...