title: Difference between new operator in C++ and new operator in java
body: <p>As far as I know, the <code>new</code> operator does the following things: (please correct me if I am wrong.)</p>
  
  <ol>
  <li>Allocates memory, and then returns the reference of the first block of the 
  allocated memory. (The memory is allocated from heap, obviously.)</li>
  <li>Initialize the object (calling constructor.) </li>
  </ol>
  
  <p>Also the operator <code>new[]</code> works in similar fashion except it does this for each and every element in the array. </p>
  
  <p>Can anybody tell me how both of these operators and different in C++ and Java:</p>
  
  <ol>
  <li>In terms of their life cycle.</li>
  <li>What if they fail to allocate memory. </li>
  </ol>