[Solved] Difference between new Class() { … } and new Class { … } [duplicate]


Nothing. When using the object initialiser syntax { }, the () for a parameterless constructor is optional.

From the overview of C# 3.0, where this syntax was introduced:

An object creation expression can omit the constructor argument list and enclosing parentheses, provided it includes an object or collection initializer. Omitting the constructor argument list and enclosing parentheses is equivalent to specifying an empty argument list.

You might find this related question of some interest.

solved Difference between new Class() { … } and new Class { … } [duplicate]