Okey, let me try to make it little more clear:
"Memory allocated for the object 'gc' on heap reclaimed ?"
If "finalize" got executed then you can be sure that the memory is deallocated.
in the other case, if "gc" not made null the finalize is not executed. "May i assume it as 'The memory allocated to gc not reclaimed even after the completion of the
main method' ".
You HAVE called System.gc() IN the main method itself so you assumption of "Completion" of main method is wrong. When the System.gc() was called the main method has not completed. And because you haven't made the reference as null, which results in an active reference to the object and hence it is ineligible for garbage collection.
"Will the finalize() surely executed before the object's deallocation ?"
YES, the finalize() will surely be called before an object is deallocated but there is NO SURETY that an object will be deallocated on calling of System.gc() as stated by Fred.
HTH.