Forgot to commit
[mono.git] / mcs / docs / ecma334 / 8.7.9.xml
1 <?xml version="1.0"?>
2 <clause number="8.7.9" title="Destructors" informative="true">
3   <paragraph>A destructor is a member that implements the actions required to destruct an instance of a class. Destructors cannot have parameters, they cannot have accessibility modifiers, and they cannot be called explicitly. The destructor for an instance is called automatically during garbage collection. </paragraph>
4   <paragraph>The example <code_example><![CDATA[
5 using System;  
6 class Point  
7 {  
8    public double x, y;  
9    public Point(double x, double y) {  
10       this.x = x;  
11       this.y = y;  
12    }  
13    ~Point() {  
14       Console.WriteLine("Destructed {0}", this);  
15    }  
16    public override string ToString() {  
17       return string.Format("({0}, {1})", x, y);  
18    }  
19 }  
20 ]]></code_example>shows a Point class with a destructor. </paragraph>
21 </clause>