title: How do I convert the content of System.out.print to a String variable in java
body: <p>I have this line of code:</p>
  
  <pre><code>    System.out.print(postalCodeIndex.findClosestBruteForce(latitude, longitude));
  </code></pre>
  
  <p>It returns output from a text file that was ran through an algorithm. For example the output is can be : "<code>A0E 2Z0 Monkstown Newfoundland NL D [47.150300:-55.299500]</code>". I would like to convert that output to a string so I can use it in a javafx GUI text. Is that posible?</p>