using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;namespace 实力5_2
{
class Program
{
public static void Main()
{
Student student = new Student(“大雄”, 12, “一中”);
Console.WriteLine(student.Name);
Console.WriteLine(student.Age);
Console.WriteLine(student.School);
}
}
class Person
{
public string Name;
public int Age;
public Person(string name, int age)
{
Name = name;
Age = age;
Console.WriteLine(“{0},{1}”, Name, Age);
}
}
class Student:Person
{
public string School;
public Student(string name,int age,string school):base(name,age)
{
School=school;
Console.WriteLine(“{0},{1},{2}”,Name,Age,School);
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Text;namespace 实力5_2
{
class Program
{
public static void Main()
{
Student student = new Student(“大雄”, 12, “一中”);
Console.WriteLine(student.Name);
Console.WriteLine(student.Age);
Console.WriteLine(student.School);
}
}
class Person
{
public string Name;
public int Age;
public Person(string name, int age)
{
Name = name;
Age = age;
Console.WriteLine(“{0},{1}”, Name, Age);
}
}
class Student:Person
{
public string School;
public Student(string name,int age,string school):base(name,age)
{
School=school;
Console.WriteLine(“{0},{1},{2}”,Name,Age,School);
}
}
}