default
constructors are redundant CS-R1028Constructors that do not take any parameters and with empty bodies are redundant and same as default
constructors. Such constructors are usually defined when auxiliary
constructors, i.e. additional overloaded constructors are defined. It is therefore recommended that you drop the explicit definition since you do not have any auxiliary
constructors defined.
class C
{
public C()
{
}
}
class C
{
public C()
{
}
}
// Valid scenario
class C
{
private int x;
public C()
{
}
// `auxiliary` constructor
public C(int x)
{
this.x = x;
}
}