title: how to check if the variable is null?
body: <p>I know this doesnt work but how can I know if the user added even one char?</p>
  
  <pre><code>public class Program
  import java.util.Scanner;
  {
  public static void main(String[] args) {
      Scanner a = new Scanner(System.in);
      String b = a.nextLine();
  
  //I know this doesnt work but how can I know if the user added even one char?
      if (b!=null){
      System.out.println(b);
  }
  }
  }
  </code></pre>