title: Exception in thread "main" java.lang.NumberFormatException: For input string: "" (I entered digits, but it seems to have read an empty string)
body: <p>There is something wrong in this section:</p>
  
  <pre class="lang-java prettyprint-override"><code>BufferedReader cin = new BufferedReader(new InputStreamReader(System.in));
  String faaltu = cin.readLine();
  String inp = cin.readLine();
  String[] part = inp.split("\\s");
  
  for(int k = 0; k &lt; part.length; k++)
  {
      System.out.println(part[k]);
  }
  
  obj.Smax = Integer.parseInt(part[0]);
  </code></pre>
  
  <p>I gave the following input:</p>
  
  <pre class="lang-none prettyprint-override"><code>2
  4 12345
  3 1234
  </code></pre>
  
  <p>Here is the complete code:</p>
  
  <pre class="lang-java prettyprint-override"><code>import java.util.*;
  import java.lang.*;
  import java.io.*;
  
  /* Name of the class has to be "Main" only if the class is public. */
  class Codejam
  {
      Codejam(){};
      static Codejam obj = new Codejam();
      int totalStanding = 0;
      int T;//no of test cases
      int[] S;// no of people at each given shyness level
      boolean[] standing;
      int Smax;
      int total = 0, newInv = 0;
  
      public static void main (String[] args) throws java.lang.Exception
      {
          // your code goes here
          BufferedReader cin = new BufferedReader(new InputStreamReader(System.in));
          obj.T = Integer.parseInt(cin.readLine());
          for(int i = 0; i &lt; obj.T; i++)
          {
              obj.populate();
              obj.update();
              while (obj.totalStanding &lt; obj.total)
              {
                  obj.newInv++;
                  obj.S[0]++;
                  obj.update();
              }
              System.out.println("Case #" + i + ": " + obj.newInv);
          }
  
  
      }
  
      public void update()
      {
          for(int i = 0;i &lt; obj.S.length; i++)
          {
              if ((totalStanding &gt;= i) &amp;&amp; (obj.standing[i] == false) )
              {
                  obj.totalStanding += obj.S[i];
                  obj.standing[i] = true;
              }
          }
      }
      public void populate() throws IOException
      {
          BufferedReader cin = new BufferedReader(new InputStreamReader(System.in));
          String faaltu = cin.readLine();
          String inp = cin.readLine();
          String[] part = inp.split("\\s");
  
          for(int k = 0; k &lt; part.length; k++)
          {
              System.out.println(part[k]);
          }
  
          obj.Smax = Integer.parseInt(part[0]);
          obj.S = new int[Smax + 1]; 
          obj.standing = new boolean[Smax + 1];
          for(int j = 0;j &lt; part[1].length(); j++)
          {
              obj.S[j] = part[1].charAt(j) - '0';
              obj.total += S[j];
  
          }
  
      }
  
  }
  </code></pre>
  
  <p>and got exception</p>
  
  <blockquote>
    <p>Exception in thread "main" java.lang.NumberFormatException: 
        For input string: "" at java.lang.NumberFormatException.forInputString(Unknown Source)
        at java.lang.Integer.parseInt(Unknown Source) 
        at java.lang.Integer.parseInt(Unknown Source)
        at Codejam.populate(Codejam.java:57)
        at Codejam.main(Codejam.java:24)</p>
  </blockquote>
  
  <p>Please point out where I have gone wrong.</p>