title: Why does this take so long to run?
body: <p>I'm a newbie to java, and I'm reading in a ~25 MB file, and it takes forever to just load... Are there any alternatives to make this faster? Is it the Scanner that can't handle large files?</p>
  
  <pre><code>String text = "";
  Scanner sc = new Scanner(new File("text.txt"));
  while(sc.hasNext()) {
  text += sc.next();
  }
  </code></pre>