Round brackets or not? Whats the difference?
问题 I've seen these two things lately and I'm a bit confused. var blah = new MyClass() { Name = "hello" } and var blah = new MyClass { Name = "hello" } Whats the difference? and why do they both work? Update: Does this mean that if i have something in a constructor which does some computation that i would have to call the first one?? 回答1: As far as I know, they're exactly equivalent. The C# specification (or at least Microsoft's implementation of it) allows you to omit the () when using the