title: How to check null element if it is integer array in Java?
body: <p>I'm quite new to Java and having an issue checking null element in integer array.
  I'm using Eclipse for editor and the line that checks null element is showing error:</p>
  
  <p>Line that complains:</p>
  
  <pre><code>if(a[i] != null) {
  </code></pre>
  
  <p>Error msg from Eclipse:</p>
  
  <pre><code>The operator != is undefined for the argument type(s) int, null
  </code></pre>
  
  <p>In PHP, this works without any problem but in Java it seems like I have to change the array type from integer to Object to make the line not complain (like below)</p>
  
  <pre><code>Object[] a = new Object[3];
  </code></pre>
  
  <p>So my question is if I still want to declare as integer array and still want to check null,
  what is the syntax for it?</p>
  
  <p>Code:</p>
  
  <pre><code>public void test() {
          int[] a = new int[3];
          for(int i=0; i&lt;a.length; i++) {
              if(a[i] != null) { //this line complains...
                  System.out.println('null!');
              }
          }
      }
  </code></pre>