■コード
public class Kihon
{
public Kihon()
{
System.Diagnostics.Debug.WriteLine(" kihon()");
}
public Kihon(string text)
{
System.Diagnostics.Debug.WriteLine(" kihon(string text)");
}
}
public class Hasei : Kihon
{
public Hasei()
{
System.Diagnostics.Debug.WriteLine(" hasei()");
}
public Hasei(string text)
{
System.Diagnostics.Debug.WriteLine(" hasei(string text)");
}
}
public class HaseiHasei : Hasei
{
public HaseiHasei()
: this("x")
{
System.Diagnostics.Debug.WriteLine(" HaseiHasei()");
}
public HaseiHasei(string text)
// : base(text)
{
System.Diagnostics.Debug.WriteLine(" HaseiHasei(string text)");
}
}
{
public Kihon()
{
System.Diagnostics.Debug.WriteLine(" kihon()");
}
public Kihon(string text)
{
System.Diagnostics.Debug.WriteLine(" kihon(string text)");
}
}
public class Hasei : Kihon
{
public Hasei()
{
System.Diagnostics.Debug.WriteLine(" hasei()");
}
public Hasei(string text)
{
System.Diagnostics.Debug.WriteLine(" hasei(string text)");
}
}
public class HaseiHasei : Hasei
{
public HaseiHasei()
: this("x")
{
System.Diagnostics.Debug.WriteLine(" HaseiHasei()");
}
public HaseiHasei(string text)
// : base(text)
{
System.Diagnostics.Debug.WriteLine(" HaseiHasei(string text)");
}
}
■実行例
System.Diagnostics.Debug.WriteLine(@"1.new Hasei(""text"")-----------------------------");
Hasei a = new Hasei("text");
System.Diagnostics.Debug.WriteLine(@"2.new HaseiHasei(""text"")------------------------");
HaseiHasei b = new HaseiHasei("text");
System.Diagnostics.Debug.WriteLine(@"3.new HaseiHasei()--------------------------------");
HaseiHasei c = new HaseiHasei();
Hasei a = new Hasei("text");
System.Diagnostics.Debug.WriteLine(@"2.new HaseiHasei(""text"")------------------------");
HaseiHasei b = new HaseiHasei("text");
System.Diagnostics.Debug.WriteLine(@"3.new HaseiHasei()--------------------------------");
HaseiHasei c = new HaseiHasei();
■実行結果
1.new Hasei("text")-----------------------------
kihon()
hasei(string text)
2.new HaseiHasei("text")------------------------
kihon()
hasei()
HaseiHasei(string text)
3.new HaseiHasei()--------------------------------
kihon()
hasei()
HaseiHasei(string text)
HaseiHasei()
kihon()
hasei(string text)
2.new HaseiHasei("text")------------------------
kihon()
hasei()
HaseiHasei(string text)
3.new HaseiHasei()--------------------------------
kihon()
hasei()
HaseiHasei(string text)
HaseiHasei()
0 件のコメント:
コメントを投稿