title: BufferedReader in java, always throws exception
body: <pre><code>public static void main (String[] args) {
  
  try{
      BufferedReader bf=new BufferedReader(new InputStreamReader(System.in));
      System.out.println ("1..case1 | 2..case2");
      String ch=Integer.parseInt(bf.readLine());       //user input for switch
      System.out.println (ch);
      bf.close();
      switch(ch) {                  //userinput ch variable switch in case
          case 1 :
              String data=bf.readLine();
              bf.close();
              System.out.println(data);
              break;
          case 2 :            
              System.out.print ("Enter Key ");
              String key=bf.readLine();
              bf.close();
              System.out.println(key);
              break;
          default :
              System.out.println ("wrong choice");        
    }
    }
  
    catch(IOException e){
      System.out.println ("io error");
    }
    bf.close();
  
  }
  </code></pre>
  
  <p>//every time after 1st user input it goes to partcular matching case, but at the next user input it throws an exception.</p>
  
  <p>please help..
  thanks in advance..</p>