共用方式為


編譯器警告 (層級 4) CS0109

更新:2007 年 11 月

錯誤訊息

成員 'member' 並未隱藏已繼承的成員。不需要此關鍵字 new。

即使宣告沒有覆寫基底類別中現有的宣告,類別宣告 (Class Declaration) 仍然包括 new 關鍵字。您可以刪除 new 關鍵字。

下列範例會產生 CS0109:

// CS0109.cs
// compile with: /W:4
namespace x
{
   public class a
   {
      public int i;
   }

   public class b : a
   {
      public new int i;
      public new int j;   // CS0109
      public static void Main()
      {
      }
   }
}