title: why BufferedReader class producing Exception at compile time not at the run time
body: <p>I know Exceptions are occurs at run time not at the time of compilation.</p>
  
  <p>so this code compiles successfully without any compile time Exception of type <code>java.lang.ArithmeticException: / by zero</code> but give an exception only at the run time </p>
  
  <pre><code>class divzero{
  public static void main(String[] arg){
  System.out.print(3/0);
  }
  }
  </code></pre>
  
  <p>but when i am using <code>BufferedReader</code> class it saying "<code>unreported exception java.io.IOException; must be caught or declared to be thrown</code>" when i am compiling the code given below. I think it should produce this exception at run time not at the time of compilation.because exceptions occurs at compile time.</p>
  
  <pre><code>import java.io.*;
  class Bufferedreaderclass{
  
  public static void main(String[] arg)
  {
  System.out.print("mazic of buffer reader \n Input : ");
  BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
  String input;
  input = br.readLine();
  System.out.print("Your input is: "+input);
  }
  }
  </code></pre>
  
  <p>I know, i should throw an exception of <code>IOException</code> type but why? i want to know why  "<code>unreported exception java.io.IOException</code>" at compile time not at run time.</p>
  
  <p>please make it clear to me why it is behaving like this ?</p>