Why are we able to call finalize() method menually....
807599Nov 21 2006 — edited Nov 21 2006Hey guys...
I was writing this small java program and learning about finalization........
I tried to call finalize() method manuallly from my public static void main(String[] args) method.....It executed it withiout any error....?
I m coming from C++ background and to the best of my knowledge (Correct me if i m wrong...)....It does not allow us to call destructor manually. So i was wondering why java allows us to call finalize() method manually...
Moreover, If someone calls finalize method manually and at the alter stage when object bcomes gargbage collected, would it be called again by JVM...? I asked this bcos JVM calls finalize() mthod only once on an object...?
U guys rock....