Comment on Tutorial - C++ Destructors Versus Java Finalization By Emiley J



Comment Added by : David

Comment Added at : 2007-10-02 06:52:20

Comment on Tutorial : C++ Destructors Versus Java Finalization By Emiley J
"This happens immediately, and before any other program statements will execute. Thus, a C++ destructor will always execute in a deterministic fashion. You can always know when and where a destructor will be executed. "

Are you sure about this??? Then there must have been a change in the language. "The C++ Programming Language by Bjarne Struostrup" (granted, not the C++ standard) says in r.12.2 "The exact point of destruction is implementation dependent." Some compilers I've used do in fact destroy temporaries and automatic variables immediately; but other compilers I have used do not. It's REALLY annoying not being able to treat destructors as deterministic. If the language DOES IN FACT define the point of destruction, then I'm writing to my compiler vendors! Please give us a paragraph reference for this behavior.


View Tutorial



Ask a Question

Subscribe to Tutorials

Related Tutorials

Program using concept of byte long short and int in java

Update contents of a file within a jar file

Tomcat and httpd configured in port 8080 and 80

Java File

Java String

Count number of vowels, consonants and digits in a String in Java

Reverse a number in Java

Student marks calculation program in Java

Handling Fractions in Java

Calculate gross salary in Java

Calculate average sale of the week in Java

Vector in Java - Sample Program

MultiLevel Inheritance sample in Java

Multiple Inheritance sample in Java

Java program using Method Overriding

Archived Comments

1. Does Wait() inside synchronized create a race cond
View Tutorial          By: Aviator168 at 2010-04-21 16:02:06

2. plz send me java prograams
View Tutorial          By: simmy at 2009-10-26 01:57:55

3. good start up fr java beginers
View Tutorial          By: sandeep Ch at 2012-01-06 07:16:34

4. Suppose we are executing a try block and faced an
View Tutorial          By: Suindu De at 2015-10-08 10:56:56

5. I want to use the same code in c++,
Can a

View Tutorial          By: vijay at 2009-09-26 00:47:02

6. Working !

Nice example, thanks !

View Tutorial          By: Akh at 2015-01-14 14:22:24

7. Thanks, this is exactly i am looking for. I need t
View Tutorial          By: Ankita at 2009-11-15 19:41:16

8. What a wonderful site for beginners? Now I can pra
View Tutorial          By: Kafedha Rwezaula at 2010-06-03 04:39:59

9. Simple and easy code..........
View Tutorial          By: mandalson at 2011-12-24 06:50:38

10. I have a HSQL query that uses many tables and I'm
View Tutorial          By: Kris Reid at 2009-11-04 15:23:40