Code Fix

上級does not implement inherited abstract member の原因と直し方 › パターン2

does not implement inherited abstract member の原因と直し方

abstractなメンバーを持つ基底クラスを継承したのに、そのメンバーをoverrideしていないと出るコンパイルエラーです。

 1  abstract class Vehicle {
 2      public abstract void Drive();
 3  }
 4  class Car : Vehicle {
 5      _____________________________________________________________________
                                          ^
 6  }
 7  class Program {
 8      static void Main(string[] args) {
 9          Car c = new Car();
10          c.Drive();
11      }
12  }
Program.cs(4,7): error CS0534: 'Car' does not implement inherited abstract member 'Vehicle.Drive()'

空欄を埋めてビルドを通す

広告
広告スロット(未設定)

does not implement inherited abstract member の原因と直し方

このエラーの解説と類題をまとめて見る →

広告
広告スロット(未設定)