title: how to replace null input from user to Zero in Java
body: <p>I am trying to replace user input which is null or nothing to zero by using
   ---if("".equals(br3.readLine())).
   i am not able to do this practise.Please help me on this.</p>
  
  <pre><code>import java.io.*;
  import java.util.*;
  
  public class abc{
      public static void main(String[] args) throws IOException
      {
          System.out.println("enter the no of test cases");
          BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
          int a=Integer.parseInt(br.readLine());
          System.out.println("no of test cases:"+a);
  
          for (int j =0;j&lt;a;j++)
          {
              System.out.println("enter for the"+(j+1)+" case");
              System.out.println("enter the no of tress");
              BufferedReader br1=new BufferedReader(new InputStreamReader(System.in));
              int b=Integer.parseInt(br.readLine());
              System.out.println("no of tress:"+b);
              int[] ar=new int[b];
              for (int i =0;i&lt;b;i++)
              {
                  System.out.println("enter the plucks for tree:"+i);
                  BufferedReader br3=new BufferedReader(new InputStreamReader(System.in));
                  if("".equals(br3.readLine()))
                  {
                      ar[i]=0;
                  }
                  else
                  {
                      ar[i]=Integer.parseInt(br3.readLine());
                  }
              }
              System.out.println("hello");
              for (int i =b-1;i&gt;=0;i--)
              {
                  System.out.println(ar[i]+"\t");
              }
          }
      }
  }
  </code></pre>