有人可以帮我理解为什么这段代码片段返回"Bar-Bar-Quux"?在阅读界面后,我很难理解这一点.
interface IFoo
{
string GetName();
}
class Bar : IFoo
{
public string GetName() { return "Bar"; }
}
class Baz : Bar
{
public new string GetName() { return "Baz"; }
}
class Quux : Bar, IFoo
{
public new string GetName() { return "Quux"; }
}
class Program
{
static void Main()
{
Bar f1 = new Baz();
IFoo f2 = new Baz();
IFoo f3 = new Quux();
Console.WriteLine(f1.GetName() + "-" + f2.GetName() + "-" + f3.GetName()); …
Run Code Online (Sandbox Code Playgroud) 有时我觉得Visual Studio 2010非常迟钝.我有一些插件,例如ReSharper,我认为可能是罪魁祸首.如果我能够在visual studio下看到进程来查看所有CPU的使用情况,那将是很好的.基本上我正在寻找的是一个任务管理器,就像谷歌Chrome中的那个,但是对于Visual Studio.我搜索了互联网并没有得到什么.