一位同事刚刚给了我一些必须在 .NET 应用程序中使用的 C# 类。
有一个我从未见过的错字,我在互联网上找不到任何解释......
这是代码:
public void GoTo<TView>() where TView : Form, new()
{
var view = Activator.CreateInstance<TView>();
//si on vient de creer une startup view alors on affiche l'ancienne
//la reference a la nouvelle sera detruite en sortant de la fonction GoTo
if (view is StartupForm)
{
ShowView(_StartupForm);
}
else ShowView(view);
}
new()
方法声明末尾的关键字是什么?