title: Taking inputs with BufferedReader in Java
body: <p>I have a bit of an annoying case here; wherein I am not able to take the input properly. I have always taken input via <code>Scanner</code>, and am not used to the <code>BufferedReader</code>. </p>
  
  <hr>
  
  <p><strong>INPUT FORMAT</strong></p>
  
  <hr>
  
  <pre><code>First line contains T, which is an integer representing the number of test cases.
  T cases follow. Each case consists of two lines.
  
  First line has the string S. 
  The second line contains two integers M, P separated by a space.
  </code></pre>
  
  <hr>
  
  <p><strong>EXAMPLE</strong></p>
  
  <pre><code>Input:
  2
  AbcDef
  1 2
  abcabc
  1 1
  </code></pre>
  
  <hr>
  
  <p><strong>My code so far:</strong></p>
  
  <hr>
  
  <pre><code>public static void main (String[] args) throws java.lang.Exception
  {
      BufferedReader inp = new BufferedReader (new InputStreamReader(System.in));
      int T= Integer.parseInt(inp.readLine());
  
      for(int i=0;i&lt;T;i++) {
          String s= inp.readLine();
          int[] m= new int[2];
          m[0]=inp.read();
          m[1]=inp.read();
  
          // Checking whether I am taking the inputs correctly
          System.out.println(s);
          System.out.println(m[0]);
          System.out.println(m[1]);
      }
  }
  </code></pre>
  
  <hr>
  
  <p>When inputting to the above example shown, I get the following output:</p>
  
  <pre><code>AbcDef
  9
  49
  2
  9
  97
  </code></pre>