java has automatic garbage collector.we can define finalize()method that will be run by the garbage collector.if we explicitely define system.gc()in a program then can the same program have finalize() method?if yes, then how will the code written in the finalize()be executed?by whom?and how to transfer the program flow to the finalize()method?
if the program can contain the finalize()method and also System.gc()then what happens if System.gc()gets executed beforew the finalize()method?
thank you.