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. Hi i have created the 5 files and in main program
View Tutorial          By: Anandkumar at 2011-09-10 05:13:59

2. Please don't use DataInputStream to read text. Unf
View Tutorial          By: Peter Lawrey at 2013-01-30 23:46:47

3. i need help for my study, i need an algorithm for
View Tutorial          By: Vincent at 2011-08-17 13:37:52

4. can this code communicate with other pc that using
View Tutorial          By: lolo at 2011-10-28 09:14:30

5. Thnx A Lot...very healpful...........
View Tutorial          By: vinay at 2012-07-19 09:21:20

6. Hi this is very clear and helpful, I would like to
View Tutorial          By: JoelC at 2012-11-06 16:23:19

7. Hai,
dis is anu, dng final year. i need to

View Tutorial          By: anu at 2012-07-12 15:41:19

8. could you plz tell me how to run this all programs
View Tutorial          By: abhishek at 2010-10-27 00:08:57

9. Better theory for those who have just started.

View Tutorial          By: kunal at 2010-05-13 05:55:05

10. good but you don't express the programs examples
View Tutorial          By: anchal at 2010-09-29 02:40:02