Part 19 .Net OOPS c#, What is Destructor, Important Interview questions on Destructor?

6
25



What is destructor?

Can we have access modifier in destructor?

Can we have parameters in destructor?

How many destructor we can have in one class?

Can we define destructor in struct data type?

Do we have any control when destructor will be called?

Do we always need to implement the destructor?

When we define destructor, which method of garbage collector is called?

Nguồn:https://wijstaanvooronzegrondrechten.org/

6 COMMENTS

  1. Can we define destructor in struct data type?
    The answer to this question is wrong. We can have destructors no matter what. The warning was coming because the variable was not used.

LEAVE A REPLY

Please enter your comment!
Please enter your name here