using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace day06 { public class Fu { public string Name { get; set; } public int age { get; set; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace day06 { public class Zi1:Fu { public string dd { get; set; } public void qq() { Console.WriteLine("我叫{0},年龄{1},健康{2}",Name,age,dd); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace day06 { class Program { static void Main(string[] args) { Zi1 zi = new Zi1(); zi.Name = "hehe"; zi.age = 10; zi.dd = "aaaaaaaa"; zi.qq(); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace day06 { public class zi21:Fu { public string aa { get; set; } public void bb() { Console.WriteLine("我叫{0},年龄{1},健康{2}", Name, age, aa); } } }