【发布时间】:2011-02-17 20:36:53
【问题描述】:
interface ILol
{
void LOL();
}
class Rofl : ILol
{
void ILol.LOL()
{
GlobalLOLHandler.RaiseROFLCOPTER(this);
}
public Rofl()
{
//Is there shorter way of writing this or i is there "other" problem with implementation??
(this as ILol).LOL();
}
}
【问题讨论】:
-
尽量避免从构造函数调用“虚拟”函数!您最终可能会调用一个访问未完全构造的对象的实现。