title: how to return value inside of class in java
body: <p>i'm a beginner in java, i try to make my 1st simple app that is allowing the user to interact with the app using voice but i have a problem on returning the result of speechRecognition. i have the following class:</p>
  
  <pre><code>class listener implements RecognitionListener{
     ....
     public void onResults(Bundle arg0){
        ArrayList&lt;String&gt; matches = arg0.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION);
            String result = matches.get(0);
     }
  }
  </code></pre>
  
  <p>in this case i wanna get the value of </p>
  
  <pre><code>result 
  </code></pre>
  
  <p>how can i get the value of it? </p>