title: Why do I get the "Unhandled exception type IOException"?
body: <p>I have the following simple code:</p>
  
  <pre><code>import java.io.*;
  class IO {
      public static void main(String[] args) {    
         BufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in));    
         String userInput;    
         while ((userInput = stdIn.readLine()) != null) {
            System.out.println(userInput);
         }
      }
  }
  </code></pre>
  
  <p>And I get the following error message:</p>
  
  <pre><code>----------
  1. ERROR in io.java (at line 10)
      while ((userInput = stdIn.readLine()) != null) {
                          ^^^^^^^^^^^^^^^^
  Unhandled exception type IOException
  ----------
  1 problem (1 error)roman@roman-laptop:~/work/java$ mcedit io.java 
  </code></pre>
  
  <p>Does anybody have any ideas why? I just tried to simplify the code given on the sum web site (<a href="http://java.sun.com/docs/books/tutorial/networking/sockets/readingWriting.html" rel="noreferrer">here</a>). Did I oversimplify?</p>