Possible Duplicate:
Why are C# 3.0 object initializer constructor parentheses optional?
Assume this is my custom object:
public class MyObject {
public string Name { get; set; }
public int number { get; set; }
public MyObject() {
}
}
and this object can defined generic, or with custom constructors and a lot of more elements, so we can make an instance and set properties in two syntax
MyObject newObj1 = new MyObject { Name = "MyName", number = 10 };
MyObject newObj2 = new MyObject() { Name = "MyName", number = 10 };
Is there any differences between instance that use parentheses and another one without parentheses?