title: Final variable resolved as non final variable - java
body: <p>I have the following piece of code to use REST service to fetch user credentials.</p>
  
  <pre><code>public class Login extends FragmentActivity
  {
      public void invokeWS(RequestParams params){
  
      final ResponseObj responseObj = new ResponseObj();
      AsyncHttpClient client = new AsyncHttpClient();
  
      client.get("http://&lt;ip&gt;:&lt;port&gt;/RestService/login/dologin",
              params, new AsyncHttpResponseHandler() {
                  @Override
                  public void onSuccess(String response) {
                      responseObj.setResponse(response);
                  }
  
                  // When the response returned by REST has Http response code
                  // other than '200'
                  @SuppressWarnings("unused")
                  public void onFailure(int statusCode, Throwable error,
                          String content) {
                      responseObj.setContent(content);
                      responseObj.setStatusCode(statusCode);
                  }
              }
          );
      }
      // rest of the logic
  }
  </code></pre>
  
  <p>However i am getting the famous "Cannot refer to the non-final local variable defined in an enclosing scope" on the variable responseObj. My variale is final and hence should be accessible. What am i missing?? </p>