Constructors and Inheritance

后端 未结 10 1075
臣服心动
臣服心动 2020-12-16 15:18

Lets take an example in C#

public class Foo
{
    public Foo() { }
    public Foo(int j) { }
}

public class Bar : Foo
{

}

Now, All the pu

10条回答
  •  误落风尘
    2020-12-16 15:58

    Some discussions

    • Joel's forum
    • Eric Gunnerson's blog

    The basic idea is to provide as much control to the creator as possible. And you can have private bases. How'd you create the object then?

提交回复
热议问题