InterviewSolution
Saved Bookmarks
| 1. |
On Throwing An Exception By The Animal Constructor In P = New Animalq, Can Memory Leak Occur? |
|
Answer» Memory of an animal class cannot leak by throwing an EXCEPTION in p = new Animal(). In case of OCCURRENCE of an exception during the Animal constructor of p = new Animal(),there is a surety of the automatic releasing of the ALLOCATED memory BACK to the heap. Memory of an animal class cannot leak by throwing an exception in p = new Animal(). In case of occurrence of an exception during the Animal constructor of p = new Animal(),there is a surety of the automatic releasing of the allocated memory back to the heap. |
|