title: URL , Scanner & Delimiter : How does this Java Line of Code Works?
body: <p>Can anyone help me  understand how does this line of code works:</p>
  
  <pre><code>String s = new Scanner(new URL("http://example.com").openStream(), "UTF-8").useDelimiter("\\A").next();
  </code></pre>
  
  <p>The code is used to directly read from the webpage.
  How exactly is the scanner object converted to a string and why we use delimiter.</p>
  
  <p>Thanks.</p>