title: inheritance and polymorphism implementation in java
body: <p>i was trying out programs to implement inheritance and polymorphism
  and i tried this one program 
  but the problem with this program is that
  every time i compile this message pops</p>
  
  <p>Compilation Errors - </p>
  
  <pre><code>/tmp/scodhvest/1471759912752_aishu.m11@gmail.com/Main.java:5: error: cannot find symbol
  BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
  ^
  symbol: class BufferedReader
  location: class Main
  /tmp/scodhvest/1471759912752_aishu.m11@gmail.com/Main.java:5: error: cannot find symbol
  BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
  ^
  symbol: class BufferedReader
  location: class Main
  /tmp/scodhvest/1471759912752_aishu.m11@gmail.com/Main.java:5: error: cannot find symbol
  BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
  ^
  symbol: class InputStreamReader
  location: class Main
  3 errors
  </code></pre>
  
  <p>this is the main class</p>
  
  <pre><code>public class Main {
  public static void main(String args[])throws Exception{
  BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
  int type,n;
  System.out.println("Enter the number of transactions");
  n=Integer.parseInt(br.readLine());
  Account[] ac=new Account[n];
  for(int i=0;i&lt;n;i++){
      Account a=new Account();
  System.out.println("Enter the account number");
  a.setAccountNumber(br.readLine());
  System.out.println("Enter the holder name");
  a.setHolderName(br.readLine());
  System.out.println("Enter the email address");
  a.setEmail(br.readLine());
  System.out.println("Enter the secret code");
  a.setSecretCode(br.readLine());
  System.out.println("Enter the number of debits");
  a.setNumberOfDebits(Integer.parseInt(br.readLine()));
  System.out.println("Enter the number of credits");
  a.setNumberOfCredits(Integer.parseInt(br.readLine()));
  ac[i]=a;
  }
  System.out.println("1)Generate Statement from account number\n"
          + "2)Generate Statement from secretcode and email\n"
          + "Enter your choice");
  type=Integer.parseInt(br.readLine());
  if(type&gt;2||type&lt;1){
      System.out.println("Invalid");
      System.exit(0);
  }
  switch(type){
  case 1: 
      System.out.println("Enter the account number");
      Account account=new Account().generateStatement(ac,br.readLine());
      if(account==null)
          System.out.println("No account found from given match");
      else{
          System.out.println("Account Number :      "+account.getAccountNumber()+"\n"
                  + "Holder Name : "+account.getHolderName()+"\n"
                  + "Number of Debits : "+account.getNumberOfDebits()+"\n"
                  + "Number of Credits : "+account.getNumberOfCredits());
      }
      break;
  case 2:
      System.out.println("Enter the secret code");
      String code=br.readLine();
      System.out.println("Enter the email address");
      Account accnt=new Account().generateStatement(ac,code,br.readLine());
      if(accnt==null)
          System.out.println("No account found from given match");
      else{
          System.out.println("Account Number : "+accnt.getAccountNumber()+"\n"
                  + "Holder Name : "+accnt.getHolderName()+"\n"
                  + "Number of Debits : "+accnt.getNumberOfDebits()+"\n"
                  + "Number of Credits : "+accnt.getNumberOfCredits());
      }
      break;
  default:
      System.out.println("Invalid");
  }
  
  }
  }
  </code></pre>