title: Null values of Strings and Integers in Java
body: <pre><code>public class Test {
      public static void main(String[] args) {
  
          String s = null;
          String s1 = null;
          Integer i = null;
          Integer i1 = null;
  
          System.out.println(s+i);
          System.out.println(i+s);
          System.out.println(s+s1);
  
          try {
              System.out.println(i+i1);
          } catch (NullPointerException np) {         
              System.out.print("NullPointerException");       
          }
      }
  
  }
  </code></pre>
  
  <p>The question is simple - why do I receive a <code>NullPointerException</code> only at the last line?</p>