title: Initializing a string in java error
body: <p>While running this code on netbeans it always run the if statement block but on compiling it on HackerRank code editor it always go into the else statement . Help me with the error.</p>
  
  <pre><code>import java.io.BufferedReader;
  import java.io.InputStreamReader;
  import java.util.Scanner;
  
  
  class Person {
  
  public static void main(String[] args) throws Exception{
      Scanner sc=new Scanner(System.in);
      BufferedReader sb=new BufferedReader(new InputStreamReader(System.in));
      int T=sc.nextInt();
      for(int j=0;j&lt;T;j++)
          {String s="";
           s=sb.readLine();
           StringBuffer even=new StringBuffer();
           StringBuffer odd=new StringBuffer();
           if(s!=null)
           {for(int i=0;i&lt;s.length();i++)
           {
               if(i%2==0)
                   even.append(s.charAt(i));
               else
                   odd.append(s.charAt(i));
           }
  
          System.out.println(even+" "+odd);
          }
           else
               System.out.println("Enter some input");
          }
     }
   }
  </code></pre>