In class2
, you are calling Console.WriteLine(c1.inf1());
.
So class1.inf1
should return a string as you are trying to output it to the console.
However, class1.inf1()
recursively calls itself with no exit and does not return a string.
So I think this may be what you are trying to accomplish:
protected internal string inf1()
{
return "
......inf1()
";
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…