- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What are finalizers in C#?
Finalizers in C# are used to destruct instances of classes. With that, you can also use it to release resources.
Here are some of the key points about Finalizers −
- Only one finalizer is allowed for a class
- You cannot inherit or overload Finalizers
- A finalizer cannot have parameters
- Finalizers invoke automatically
Finalizers in C# are declared like destructors. Let’s say the class name is Demo, therefore, the following would be our finalizer −
~Demo() { // }
The finalizer declaration is prefixed with a tilde before the class name.
Advertisements
To Continue Learning Please Login
Login with Google