could anyone tell me what all options are right among the following 1) we can call finalize method expicitly ( i think yes in case of overided method) 2) finalize must be declared with protected accessibility ( but if we override it then we can change the accessibility ??) 3) if an object is collected by GC its finalize method is guranted to be called
Hi Nishesh, 1) Yes you can call your own finalize method. Since it has protected access you can't call any objects finalize method. 2) Yes, but remember an overridding method must not be less accessable than that of the overridden. Therefore, you can make it default or public but not private! 3) Yes that is what the JVM stipulates. Regards, Manfred.
We should throw him a surprise party. It will cheer him up. We can use this tiny ad:
a bit of art, as a gift, the permaculture playing cards