Computer Science, asked by RohithRock4707, 10 months ago

Q) difference between final, finally and finalize?

Answers

Answered by smrityrai53
0

Final class can't be inherited final method can't be overhidden and final variable value can't be changed. Finally is used to place important code , it will be excuted whether exception is handle or not. Finalize is used to perform clean processing just before is garbage collected

Answered by Oreki
1

\begin{small}\begin{tabular} {l|l|l}\textbf{final} & \textbf{finally} & \textbf{finalize}\\\textsf{$\cdot$ Keyword} & \textsf{$\cdot$ Block} & \textsf{$\cdot$ Method.}\\\textsf{$\cdot$ Used to d\symbol{101}fine constants} & \textsf{$\cdot$ A block that executes after } & \textsf{$\cdot$ Executed just before the}\\ \textsf{\hspace{.37em} in the program} & \textsf{\hspace{.37em} the try-catch blocks, if d\symbol{101}fined} & \textsf{\hspace{.37em} object is collected by the GC}\end{tabular}\end{small}

Similar questions