Solving the 'Virtual method call in constructor' issue

前端 未结 5 1714
悲哀的现实
悲哀的现实 2020-12-31 03:22

I am making a software in c#. I am using an abstract class, Instruction, that has these bits of code:

protected Instruction(InstructionSet instr         


        
5条回答
  •  一整个雨季
    2020-12-31 03:53

    Another option is to introduce an Initialize() method, where you do all the initialization that requires a fully-constructed object.

提交回复
热议问题