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



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. Great!
Thnks for your help..

View Tutorial          By: ramu at 2011-06-18 07:56:56

2. Thanks !
View Tutorial          By: Swaran at 2010-02-02 23:50:13

3. Yeah, great article
View Tutorial          By: smeagol_s at 2009-03-29 02:45:01

4. Nothing that hasn't been said before, but I wasn't
View Tutorial          By: Calvin at 2010-03-22 20:43:10

5. lolz what's the code not working in JSP may be sen
View Tutorial          By: lolz at 2008-12-10 03:31:50

6. pls can any one have any idea about storing the ca
View Tutorial          By: souhir at 2010-01-30 11:04:48

7. hello after working with this code i got the follw
View Tutorial          By: Tapaswini Sabat at 2011-11-05 12:43:49

8. excellent for a beginer in inet address ...
View Tutorial          By: Tony at 2009-08-13 22:39:48

9. I used two phrases of the security section for the
View Tutorial          By: pabo at 2010-04-05 05:22:24

10. Please
Can you help me ^-^
I use th

View Tutorial          By: HNO11 at 2011-03-28 11:08:28