1. using System;
    2. using System.Collections.Generic;
    3. using System.Text;
    4. namespace _052_面对对象初级_7_析构函数
    5. {
    6. class Class1
    7. {
    8. //析构函数
    9. //当程序结束的时候,析构函数才执行
    10. //作用: 可以帮助我们释放资源
    11. // GC garbage collection
    12. ~Class1()
    13. {
    14. Console.WriteLine("析构函数!!!!!");
    15. }
    16. }
    17. }