• 2022-06-12
    以下C#代码中,关于虚方法和抽象方法使用正确的是()
    A: publicabstractclassAnimal{publicAnimal(){}}publicabstractvoidRun():Animal{publicCat(){}publicvoidRun(){}}
    B: publicclassAnimal{publicAnimal(){}}publicabstractvoidRun():Animal{publicCat(){}publicvoidRun(){}}
    C: publicabstractclassAnimal{publicAnimal(){}publicabstractvoidRun();}publicclasscat:Animal{publicCat(){}publicoverridevoidRun(){}}
    D: publicvirtualclassAnimal{publicAnimal(){}publicvirtualvoidRun();}publicclasscat:Animal{publicCat(){}publicoverridevoidRun(){}}
  • 举一反三