我很菜啊,编译下面代码时出错了,帮忙看看啊!
先谢谢了!
using System; // Namespace Declaration
class OutputClass // helper class
{
string myString;
public OutputClass(string inputString) // Constructor构造器
{
myString = inputString;
}
public void printString() // Instance实例 Method
{
Console.WriteLine("{0}", myString);
}
~OutputClass() // Destructor
{
} // Some resource cleanup routines
}
class ExampleClass // Program start class
{
public static void Main() // Main begins program execution.
{
OutputClass outCl = new OutputClass("This is printed by the output class.") {} // Instance of OutputClass
outCl.printString(); // Call Output class' method
}
}
错误提示是:classes.cs(22,80): error CS1002: ; expected