Should we always include a default constructor in the class?
I have been asked this question by a colleague that should we always include a default constructor in a class? If so, why? If no, why not? Example public class Foo { Foo() { } Foo(int x, int y) { ... } } I am also interested to get some lights on this from experts. You have to keep in mind that if you don't provide an overloaded constructor, the compiler will generate a default constructor for you. That means, if you just have public class Foo { } The compiler will generate this as: public class Foo { public Foo() { } } However, as soon as you add the other constructor public class Foo {