title: reading contents from a webpage java
body: <pre><code>URL u = new URL("http://java.sun.com/index.html");
  URLConnection conn = u.openConnection();
  InputStream stream = conn.getInputStream();
  Scanner in = new Scanner(stream); 
  </code></pre>
  
  <p>Using the above code may cause unchecked or checked exceptions. So I'm unsure what exceptions I should consider. checked exceptions occur no matter how careful you are and unchecked exceptions are runtime exceptions (usually)? So looking at each line of the above code, line 1 the URL may not exist, so would this be an unchecked exception, NoSuchElementExistsException? and line 2 URLconnection will open so long as the url is correct, so those two lines are coupled together...</p>
  
  <p>Now I think the remaining 2 lines, InputStream and Scanner in are accounted for? Am I missing anything? </p>