在 Main
中,透過在 MyMethod
中使用特定的關鍵字來插入缺失的部分,以列印數字 8。
static int MyMethod(int x) { @(6) 5 + x; } static void Main(string[] args) { Console.WriteLine(MyMethod(3)); }
static int MyMethod(int x) { return 5 + x; } static void Main(string[] args) { Console.WriteLine(MyMethod(3)); }