Override get, But not set

前端 未结 13 2472
暖寄归人
暖寄归人 2020-12-14 14:17

I have an abstract class that defines a get, but not set, because as far as that abstract class is concerned, it needs only a get.

13条回答
  •  旧时难觅i
    2020-12-14 15:03

    Why not just have a property in the base class that has a private setter, then in your subclass that needs the setter, override it and make it public.

提交回复
热议问题