Pēcis Beisikāns' Journal
View:Personal Journal.
View:Friends.
View:Calendar.
Missed some entries? Then simply jump to the previous day or the next day.

Wednesday, March 24th, 2004

Time:4:14 pm.

static void Main(string[] args)
{
    // vienkarshi
    Messiah jesus = new Messiah();
    System.Console.WriteLine( "You are " + jesus.save() );
    jesus.Dispose();

    // efektiivi, bet ne korekti
    System.Console.WriteLine( "You are " + ( new Messiah() ).save() );

    // konkreeti
    System.Console.WriteLine( "You are " + Jesus.saves() );
}

[...]

class Messiah: IDisposable
{
    public string save()
    {
        return "saved";
    }

#region IDisposable Members

    public void Dispose()
    {
        // TODO: Add Messiah.Dispose implementation
    }

#endregion
}

class Jesus: Messiah
{
    public static string saves()
    {
        using( Messiah j = new Messiah() )
        {
            return j.save();
        }
    }
}

Comments: Add Your Own.

Pēcis Beisikāns' Journal

View:User Info.
View:Friends.
View:Calendar.
View:Memories.
Missed some entries? Then simply jump to the previous day or the next day.