namespace PersonNamespace {
protected string fullName;
public Person(string name, int age) {
public void DisplayInfo() {
Console.WriteLine(this.fullName);
Console.WriteLine(this.age);
public class Student : Person {
private string studentProgram;
public Student(string name, int age,
long id, string program) : base (name, age) {
this.studentProgram = program;
public void DisplayStudentInfo() {
Console.WriteLine(this.studentID);
Console.WriteLine(this.studentProgram);
public class DemoInheritance {
public static void Main() {
Student student = new Student("Ash",12,123,"BSIT");
student.DisplayStudentInfo();