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. can i have a piece of program so that i can improv
View Tutorial          By: miniboss at 2010-11-12 06:09:41

2. Thanks! It worked fine for me.
View Tutorial          By: John Franklin at 2009-04-02 10:37:44

3. i run above code in my netbean ide, i din't get ou
View Tutorial          By: manish sharma at 2013-04-03 05:28:40

4. this what i get on the servlet web page plz some o
View Tutorial          By: boney dsilva at 2012-09-19 15:37:09

5. Excellent !...That explains my long-term question
View Tutorial          By: Vineeth at 2012-02-01 03:50:21

6. Hi,
I done very simple, just copy the strut

View Tutorial          By: sridhar at 2009-03-01 19:17:10

7. where is the main class .
View Tutorial          By: rishi at 2015-10-02 10:17:17

8. ----- main---
Inside Run ...
OK 0 <

View Tutorial          By: pushpam at 2009-01-23 06:14:07

9. Your solution won't work if you have 2 different f
View Tutorial          By: mkieu at 2012-06-19 00:04:29

10. Amazing tutorial!! This is what I was exactly look
View Tutorial          By: Sumanth Vaidya at 2015-06-17 18:19:16