C# 抽象类 abstract
抽象类和重写
using Mysqlx.Notice; using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using System.Timers; namespace ClassAndIn { internal class Program { static void Main(string[] args) { Car car = new MiCar(); car.Run(); } } // 抽象类 abstract class Car { // 抽象方法 public abstract void Run(); } class MiCar : Car { public override void Run() { //throw new NotImplementedException(); Console.WriteLine("speeding is fast ..."); } } }