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. sir will you please tell me how i get out of all t
View Tutorial          By: mitali at 2012-05-06 09:54:49

2. this code works very well for me , but it runs onl
View Tutorial          By: m. usman at 2013-08-31 14:17:22

3. very very useful..thank you
View Tutorial          By: sridaran at 2009-03-21 00:45:21

4. Hi,

Your COM port is currently in u

View Tutorial          By: Ramlak at 2008-04-14 07:29:55

5. Hi, I need the complete working code for sending a
View Tutorial          By: Balaji Srikaanth at 2007-03-10 01:22:35

6. thankx a lot...i've been trying so hard to learn t
View Tutorial          By: bhuwan at 2009-04-08 23:30:45

7. its good
View Tutorial          By: Srinu at 2011-05-26 23:57:18

8. very nice approach sir....
u make it very e

View Tutorial          By: aamir at 2011-06-15 01:29:22

9. I am an MCA student i wanna know whether one can s
View Tutorial          By: RAJU.K at 2009-07-24 02:28:21

10. It too good code
View Tutorial          By: Srinivas at 2011-02-20 03:58:19