It's a cunning, but pointless, infinite loop, isn't it?
finalize() is a poor mechanism, with few real uses. Not much point getting to involved in it.
Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
Joined: Dec 14, 2004
I still do not understand the use of this method. If you creating a new object inside the finalize. This object will be available for GC again in this new object GC will call the finalize method which creates another new object. But this goes on util the JVM will exist. So basically the GC is going in loops. for removing one single object. This is my conclusion from this code.
I do not know if this is correct or not. Comments and suggestions are welcome.
Well guys here is what happens. Nothing will happen. The GC will not go in a loop nor the JVM will crash. As per the rules of GC the program will exit normally. Here is the link from Java Forums by Sun. that explains it clearly