What do you mean by “finalize” and “finally” methods in C#?
S.no | finally | finalize |
---|---|---|
1. | Called after execution of block | Called before garbage collection |
2. | Used for exception handling. | Used for performing clean up operations |
3. | Usually contains clean-up code | Automatically called when an instance is not called subsequently. |
BY Best Interview Question ON 13 Feb 2019