return value of new in java
<p>What would be the return value of new in java in case of insufficient memory? I have the following code </p>

<pre><code>TreeNode newNode = new TreeNode(n);
if(newNode == null)
    return false;
</code></pre>

<p>eclipse says that it is a dead code. How should we check for memory error in java?</p>
