title: Unresolved compilation: Unhandled exception type IOException
body: <p>When trying to write read an int from standard in I'm getting a compile error.</p>
  
  <pre><code>System.out.println("Hello Calculator : \n");        
  int a=System.in.read();
  </code></pre>
  
  <p>The program throws an exception:</p>
  
  <pre><code>Exception in thread "main" java.lang.Error: Unresolved compilation problem: 
  Unhandled exception type IOException at SamplePackege.MainClass.main(MainClass.java:15)
  </code></pre>
  
  <p>How do I fix this error?</p>
  
  <p>My Code :</p>
  
  <pre><code>try {
      Scanner sc = new Scanner(System.in);
      int a=sc.nextInt();
  } catch (Exception e) {
      // TODO: handle exception
  }
  </code></pre>