Is there any difference between `new object()` and `new {}` in c#?
问题 in c#, var x = new {}; declares an anonymous type with no properties. Is this any different from var x = new object(); ? 回答1: Yes, the types used are different. You can tell this at compile-time: var x = new {}; // Won't compile - no implicit conversion from object to the anonymous type x = new object(); If you're asking whether new{} is ever useful - well, that's a different matter... I can't immediately think of any sensible uses for it. 回答2: Well, for starters, object is an actual, non