> For the complete documentation index, see [llms.txt](https://andreyakinshin.gitbook.io/problembookdotnet/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://andreyakinshin.gitbook.io/problembookdotnet/en/oop/overloadresolutioninheritance-p.md).

# “OverloadResolutionInheritance” (Problem)

What will the following code display?

```csharp
class Foo
{
  public Foo()
  {
    Quux();
  }
  public virtual void Quux()
  {
    Console.WriteLine("Foo.Quux()");
  }
}
class Bar : Foo
{
  protected string name;
  public Bar()
  {
    name = "Bar";
  }
  public override void Quux()
  {
    Console.WriteLine("Bar.Quux(),  " + name);
  }
  public void Quux(params object[] args)
  {
    Console.WriteLine("Bar.Quux(params object[])");
  }
}
class Baz : Bar
{
  public Baz()
  {
    name = "Baz";
    Quux();
    ((Foo)this).Quux();
  }
}
void Main()
{
  new Baz();
}
```

[Solution](/problembookdotnet/en/oop/overloadresolutioninheritance-s.md)
