Say I have a struct
public struct Foo
{
...
}
Is there any difference between
Foo foo = new Foo();
and <
You might wonder why, if they are exactly the same, there are two ways to do the same thing.
They are not quite the same because every reference type or value type is guaranteed to have a default value but not every reference type is guaranteed to have a parameterless constructor:
static T MakeDefault()
{
return default(T); // legal
// return new T(); // illegal
}