Should you use constructor or factory method?
Views: 1561
Constructor We have been using constructors in object-oriented programming languages such as Java, C++, etc. A constructor is a special type of static method which can be invoked using thenew keyword and used to initialize the fields of a newly created object. Problem with constructors The name of the...