using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication10
{
abstract public class Animal
{
public string A_name;
public string A_Type;
public Animal(string name)
{ A_name=name;
A_Type="动物";
}
public virtual string Getname(){
Console.WriteLine("当前的动物是{0},名字是{1}",A_name,A_Type);
return A_name;}
}
class Dog:Animal{
public Dog(){ //错误 1 “ConsoleApplication10.Animal”不包含采用“0”参数的构造函数
A_Type="狗";}
public override string Getname(){ //错误 2 “ConsoleApplication10.Dog.Getname()”: 并非所有的代码路径都返回值
base.Getname();
}
}
class Program
{