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 sample. Happy I found this site.
View Tutorial          By: javaslave at 2008-08-03 04:43:20

2. I get this error:
Can someone please help m

View Tutorial          By: Carlos at 2010-06-14 02:42:53

3. javax.microedition.io.ConnectionNotFoundException:
View Tutorial          By: yellaiah at 2014-12-27 05:18:52

4. This works great.. :)

thanks a lot

View Tutorial          By: Ravi at 2010-07-03 23:34:46

5. Right, so were is the tutorial files.zip?
O

View Tutorial          By: jeremy at 2011-10-24 15:58:40

6. i am in beginning level, i tried by this code. but
View Tutorial          By: Shahana Akter at 2014-09-09 10:30:21

7. this is no doubt a simple program for the learner
View Tutorial          By: shweta at 2008-07-12 01:18:59

8. Respected sir,
I am trying to embed windows

View Tutorial          By: arshad at 2011-10-22 17:05:21

9. sir... i made a program just like that ... but the
View Tutorial          By: David at 2010-07-08 03:34:13

10. Hi Steve.
I have two applications; 1 listen

View Tutorial          By: Victor at 2010-08-18 01:22:49