Home All Groups Group Topic Archive Search About

Force constructor in derived class

Author
24 Dec 2005 10:18 AM
Lorenzo Soncini
Hi everybody, I have a class whit 3 costructor like this:

public class MyClass {
    public MyClass ()
    {
    }
    public MyClass (int A)
    {
    }
    public MyClass (int A,string B)
    {
    }
}

How I can force any derived class from MyClass implements the same
costructor?

Thanks
Lorenzo Soncini

Author
24 Dec 2005 11:03 AM
Jon Skeet [C# MVP]
Lorenzo Soncini <lorenzo.sonc***@technoservice.com> wrote:
Show quote
> Hi everybody, I have a class whit 3 costructor like this:
>
> public class MyClass {
>     public MyClass ()
>     {
>     }
>     public MyClass (int A)
>     {
>     }
>     public MyClass (int A,string B)
>     {
>     }
> }
>
> How I can force any derived class from MyClass implements the same
> costructor?

You can't, I'm afraid.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet   Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too

AddThis Social Bookmark Button