title: Return a value from asynchronous call to run method
body: <p>I have a method that has to return a boolean value. The method has an asynchronous call to run method. In the run method, i have to set variable in the enclosing method. below is my code.</p>
  
  <pre><code>private boolean isTrue() {
      boolean userAnswer;
      Display.getDefault().asyncExec(new Runnable() {
          public void run() {
              userAnswer = MessageDialog.openQuestion(new Shell(), "some message", "some question?");
          }
      });
      return userAnswer;
  }   
  </code></pre>
  
  <p>This code gives error -- "userAnswer" has to be final, and if i  make it final i cant assign a value to it. Please suggest a way to handle this scenario.</p>