Why might one also use a blank constructor?

前端 未结 10 582
傲寒
傲寒 2020-12-16 04:59

I was reading some Java recently and came across something (an idiom?) new to me: in the program, classes with multiple constructors would also always include a blank constr

10条回答
  •  一整个雨季
    2020-12-16 05:12

    That is NOT a copy constructor. Basically you want empty constructors when working with some framework. Shall there always be an empty constructor, of course, public or private, but at least it allows you to keep control of how the class is being (or not) instantiated.

提交回复
热议问题