Destructors Flashcards

1
Q

What is a destructor?

A
  • It is a function that gets called when the instance of a class must be destroyed
  • It is caled implicitly by .NET fra,ework’s garbage collector
  • Developer cannot explicitly invoke the destructor
  • It cannot be overloaded or inherited
  • Distinguished apart from a constructor because of the Tilde symbol (~) prefixed to its name
  • Does not accept any parameters and modifiers
  • It cannot be defined in Structures. It is only used with classes
  • There cannot be more than one destructor in a class.
  • Has no return type and has exactly the same name as the class name (Including the same case).

https://www.geeksforgeeks.org/destructors-in-c-sharp/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly