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. Really The Best Start for mE
View Tutorial          By: neeraj at 2012-01-26 13:27:31

2. hi,
i got an exception :in thread mai

View Tutorial          By: N.Venugopal at 2009-08-27 05:25:07

3. Thank you so much....
I am going to have ja

View Tutorial          By: Mehrnoosh at 2013-06-09 16:50:23

4. it is nice but please give simple example like are
View Tutorial          By: red at 2009-12-03 23:07:37

5. thanks for this tutorial! it's very useful
View Tutorial          By: Miguel at 2011-06-26 21:15:00

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

7. it is good
View Tutorial          By: kamal at 2009-11-01 19:58:54

8. Good work!

Few changes: polish oper

View Tutorial          By: Karol Z. at 2010-06-02 09:09:52

9. Hi DILIP !
Can you plz help me I have an ex

View Tutorial          By: Bull at 2012-01-25 16:16:36

10. how to connect jdbc in java on mysql
View Tutorial          By: saravana kumar at 2012-01-30 06:06:57