<p>I need to determine the current year in Java as an integer. I could just use <code>java.util.Date()</code>, but it is deprecated.</p>

For Java 8 onwards:
```
```
int year = Year.now().getValue();
```
```
For older version of Java:
```
```
int year = Calendar.getInstance().get(Calendar.YEAR);
```
```