I have two classes: Foo and Bar, which have such constructors:
class Foo { Foo() {
Now I want to introduce a constructor for Bar that accepts int, but I want the stuff that happens in Bar () to run the same way as stuff from Foo (int). Something like that:
Bar(int arg) : Bar(), base(arg) {
Is there any way to do this in C #? The best I'm still doing is making Bar () work as a function, which is also called by Bar (int), but it's rather inelegant.
constructor c #
reilly Dec 02 '08 at 20:21 2008-12-02 20:21
source share