Difference between final, finally and finalize in Java
final locks: variable cannot reassign, method cannot override, class cannot extend. finally is the try cleanup block. finalize is an old GC callback — do not use it in new code.
Viva loves mixing these three. Answer in three short lines. Don’t write one mixed paragraph.
finally is for close(). final is for MAX = 100 or a locked design. finalize is history.
Let's take this on the board with one tiny Main class — no extra files. Output: Asha scored 72 then Pass. Real Main. Swap marks/name to show one idea from Difference between final, finally and finalize in Java. Start from main, go line by line, and stop at each print. That output is the proof for Difference between final, finally and finalize.
Three lines: final locks, finally cleans up after try, finalize is old GC — don’t use it.