Call Constructor Base after Code Execution

后端 未结 9 2198
攒了一身酷
攒了一身酷 2021-02-12 12:33

Let say we have Class A and Class B. ClassB extends Class A. (ClassB : ClassA)

Now let\'s say that whenever I instantiate ClassB, I\'d like to Run some Random code and o

9条回答
  •  死守一世寂寞
    2021-02-12 13:22

    You can't do that with C#. Your best bet is to extract that code into it's own method in the parent and then call that from the child when you're ready.

提交回复
热议问题