using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace t1
{ class student1
{ int age;
string name;
private student1(int age,string name)
{
age=age;
name=name;
}
void print()
{console.writline(“年龄={0},姓名={1};”,age,name);
}
class student2:student1
{ int ID;
student2(int ID):student1(int age,string name)
{
ID=ID;
return ID;
}
void print()
{print();
console.writeline(“学号={0}”,ID);
}
}
}
class program
{static void main(string[] args )
{student1 s1=new student1(19,”lim”);
student2 s2=new student2(255);
s1.print();
s2.print();
}
}
|