예제) 생성자의 상속(2) –case 2

 

 

 

 

class Student : People

{

  public int age = 0;

  public Student() : base(“kym")

  {

  this.age = 16;

  }

}

 

class Program

{

  public static void Main()

  {

  Student a = new Student();

  Console.WriteLine(a.name);

  }

}

 

 

 

 

+ Recent posts