为啥不能继承
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace protest
{
class Program
{
static void Main(string[] args)
{
dog dog1 = new dog();
dog1.name = "jack";
dog1.printname();
}
}
}
public class pet
{
public string name;
public void printname() { Console.WriteLine("宠物的名字是"+"name"); }
}
public class dog : pet { }