A practical comparison of the Java and C++ resource management facilities
Abstract
This paper is a comparative description of the resource management features of the Java and C++ programming languages. Although there are already many "comparisons" of those two languages, it's the opinion of the author that most of them are not very professional by means of objectivity. I tried really hard to be objective (or at least more objective) and show the strength and weaknesses of both languages.
The paper is divided into four sections, the first discusses the memory management and focuses on exception safety, the second compares the java finalizer and the C++ destructor. The third section discusses java finally blocks, and how C++ avoids the requirement for those. The last section puts the pieces together and implements a commonly used structure in both languages.
Full pager, 8 Pages2003-02-08