title: How can I call a class variable from a callback function?
body: <p>I have a class that has this structure:</p>
  
  <pre><code>public class MyClass {
  
      private double myDouble;
      private MyObject myObject;
  
      public myMethod() {
  
          AnotherObject anotherObject = new AnotherObject();        
          anotherObject.getInfo(new Callback&lt;String&gt;() {
              @Override
              public void success(MyObject myObject) {
                  this.myObject = myObject; // this is what I would like to do
              }
  
              // and a method for the failure case
          });
  
      }
  }
  </code></pre>
  
  <p>Essentially, I am looking for a way to save the value of <code>myObject</code> that I get from the <code>success</code> method inside the instance variable <code>myObject</code> (<code>this.myObject</code>). Currently, with the above code, I get a "Cannot resolve symbol 'myObject'" message.</p>
  
  <p>Is this possible?</p>