Can we interrupt creating an object in constructor

前端 未结 7 1438
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-31 03:46

Could you help me please. I have one idea but don\'t know how can I implement it.

So the question is: Can we interrupt creating an object in constructor i.e.

7条回答
  •  离开以前
    2020-12-31 04:14

    If the parameters to your constructor are invalid, consider throwing ArgumentException or one of its descendant classes (e.g. ArgumentOutOfRangeException).

提交回复
热议问题