using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ConsoleApplication1{ class Pet { public string Name; public void PrintName() { Console.WriteLine("pet's name is " + Name); } } class Dog:Pet { new public void printName() { Console.WriteLine("我的名字是哪个诶"+Name); } } class Program { static void Main(string[] args) { Dog dog = new Dog(); dog.Name = "jack"; dog.PrintName(); } }}
添加回答
举报
0/150
提交
取消