title: How to pass variable outside loop?
body: <p>I've this variable:</p>
  
  <pre><code>String foo;
  
  for(String links: Result){
  
      String myVariable="\n"+foo;
  }
  
  System.out.println(foo); //loop is giving error here..
  </code></pre>
  
  <p>How to use <code>foo</code> variable outside <code>for loop</code> in Java?</p>