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. good....
View Tutorial          By: Rini at 2013-01-08 10:44:54

2. Thank you... I have the same problem , I have date
View Tutorial          By: makoy at 2012-01-16 09:06:34

3. hi,

i'm a jmeter user.in my test i

View Tutorial          By: mahesh at 2015-03-06 16:58:05

4. Perfectly working, and able to connect database.
View Tutorial          By: satyajit at 2012-06-01 20:16:53

5. here is one more inner class example
public

View Tutorial          By: shahalam shaikh at 2012-02-13 21:08:30

6. Exception in thread "main" java.lang.NoC
View Tutorial          By: RobustTm at 2008-12-18 23:19:46

7. I have loaded allthe 5 java files.But how to imple
View Tutorial          By: ashish at 2007-03-08 20:33:11

8. hi,

i have a problem. I have the ti

View Tutorial          By: Felipe at 2010-02-18 05:03:51

9. this site is very useful to the freshers ...

View Tutorial          By: sweth at 2009-09-02 18:53:46

10. Thanks for posting this :)
Being a noobie @

View Tutorial          By: C at 2008-06-23 18:17:26