using System;
class Driver
{
public static void Main()
{
Console.WriteLine ("Starting Main");
// Invoke a static method on Test
Test.EchoAndReturn ("Echo!");
Console.WriteLine ("After echo");
// Reference a static member of Test
string y = Test.x;
// Use the value just to avoid compiler cleverness
if (y != null)
Console.WriteLine ("After field access");
}
}
class Test
{
public static string x = EchoAndReturn ("In type initializer");
public static string EchoAndReturn (string s)
{
Console.WriteLine (s);
return s;
}
}