Java declaration confusion for datatypes
<p>I have a doubt about null assigning to variable in Java. In my program I have assigned null to String variable as <code>String str_variable = null;</code>.  For the learning purpose i assigned null integer variable as <code>int int_variable = null;</code> It shows error <code>Add cast with Integer</code>. So that rewrite the above int declaration as <code>Integer int_variable = null;</code>. This does not shows errors. I do not know the reason of these two kind of declaration.</p>

<p>Please the difference between to me.</p>

<pre><code>String str_variable = null;

int int_variable = null; // error.

Integer int_variable1 = null; // no error.
</code></pre>
