--%>

Destructor in C sharp programming language

Why the destructor not executed if we have defined a destructor in the class which we have developed through C# programming language?

E

Expert

Verified

Runtime environment automatically calls up a destructor of the class to release a resource which is occupied by the variables and the methods of the object. But, in C#, programmers cannot control the timing for calling destructors, since Garbage Collector is only in charge for releasing the resources used by the object. Garbage Collector automatically acquires information regarding unreferenced objects from .NET's runtime environment and then calls up the Finalize() method.

Even though, it is not preferable to force Garbage Collector to carry out garbage collection and recover all inaccessible memory, programmers can utilize the Collect() method of a Garbage Collector class to forcefully perform Garbage Collector.

   Related Questions in Software Engineering

  • Q : Problem regarding inheritance I need a

    I need a good answer on the topic of Software engineering problems. Please give me your suggestion for the same by using following options. The characteristic of the object oriented paradigm that helps code reuse is: (1) Object. (2) Aggregation. (3) Inheritance. (4) C

  • Q : Problem on Structured charts I require

    I require a good answer on the topic of Software engineering problems. Please give me your suggestion for the same by using following options. Structured charts are a product of: (i) requirements gathering (ii) Design (iii) Requirements analysis (iv) Coding.

  • Q : Main use of the User Interface

    Describe briefly the main use of the User Interface prototyping?

  • Q : Techniques for finding out the

    List out all the different techniques for finding out the Cyclomatic Complexity?

  • Q : Metrics specifying non functional

    Specify the metrics to specify the non functional requirements?

  • Q : Web programming languages Does

    Does pre-compilation of loop limits in the Web programming languages such as ColdFusion, Java and JavaScript assist?

  • Q : Task regions in the Spiral model List

    List out the task regions in the Spiral model in brief.

  • Q : Anti-venom serums for treatment and

    Why some vaccines which is used in the prevention are not used for the treatment of the infections? Why anti-venom serums are used in the treatment and prevention?

  • Q : Define analysis model Define the term

    Define the term analysis model?

  • Q : Meaning of CASE Tool Hello guys I want

    Hello guys I want your advice. Please recommend some views for following Software Engineering problems. The CASE Tool stands for: (i) Computer Aided Software Engineering. (ii) Constructive Aided Software Engineering. (iii) Component Aided Software Engineering. (iv) Co