using System;
class BaseClass
{
public BaseClass(string s)
{
Console.WriteLine(s);
}
}
class DerivedClass:BaseClass
{
public DerivedClass(string s1, string s2)
: base(s1)
{
Console.WriteLine(s2);
}
}
class MainClass
{
static void Main()
{
/* 出力値
* BaseClass
* DerivedClass */
DerivedClass sample
= new DerivedClass
("BaseClass", "DerivedClass");
}
}
0 コメント:
コメントを投稿