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

 

 

 

 

class Student : People

{

   public int age = 0;

     public Student(){

  this.age = 16;

   }

}

 

class Program{

   public static void Main(){

        Student a = new Student();

   //Student b = new Student("Boo..");  // 이건 에러..

   Console.WriteLine(a.name);

   }

}

 

 

 

 

 

+ Recent posts