This post contains the following source code:
class Foo
{
private int x;
private int y;
public Foo(int x, int y)
{
this.x = x;
this.y = y;
SideEffects.Alpha(); // Notice: does not use "this"
}
~Foo()
{
SideEffects.Charlie();
}
}
static class SideEffects
{
public static void Alpha() { ... }
public static void Bravo() { ... }
public static void Charlie() { ... }
public static void M()
{
Foo foo = new Foo(1, 2);
Bravo();
}
}
What does ~
do?