How to get current year in android?
<p>I tried</p>

<pre><code>int year = Calendar.get(Calendar.YEAR);
</code></pre>

<p>but it is giving me compile time error that </p>

<blockquote>
  <p>Non-static method 'get(int)' cannot be referenced from a static context.</p>
</blockquote>

<p>I am calling this method from call method of observable.</p>

<pre><code>Observable.combineLatest(ob1 ob2,
                ob3, new Func3&lt;String, String, String, Boolean&gt;() {
                    @Override
                    public Boolean call(String a, String b, String c) {...
</code></pre>

<p>I had also seen <code>(new Date()).getYear();</code> but it is deprecated.</p>