小编B-L*_*k-a的帖子

为什么这个C#代码会返回它的功能

有人可以帮我理解为什么这段代码片段返回"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)

c# interface code-snippets

37
推荐指数
2
解决办法
2510
查看次数

是否有像Visual Studio应用程序的任务管理器?

有时我觉得Visual Studio 2010非常迟钝.我有一些插件,例如ReSharper,我认为可能是罪魁祸首.如果我能够在visual studio下看到进程来查看所有CPU的使用情况,那将是很好的.基本上我正在寻找的是一个任务管理器,就像谷歌Chrome中的那个,但是对于Visual Studio.我搜索了互联网并没有得到什么.

visual-studio

7
推荐指数
1
解决办法
1424
查看次数

标签 统计

c# ×1

code-snippets ×1

interface ×1

visual-studio ×1