How do you think what can be difference between them?
new object[][] { new object[] { "1" }, new object[] { "2" }, new object[] { "3" } }
new object[] { new object[] { "1" }, new object[] { "2" }, new object[] { "3" } }
They only difference I see is overloaded params of methods.
static void Arr(object[][] oa)
static void Arr(object[] oa)
Maybe effeciency of memory?
The first one is type-safe; the second one isn’t.
Both of your arrays are exactly the same, except that the second array is typed as containing
objects, whereas the first one must containobject[]s (arrays). Therefore, you could writeWhereas you cannot write
…because
DateTime.Nowis not anobject[].In practice, you should try to use the most restrictive type possible to prevent you from making mistakes.
In your case, you should use a
string[][]to make sure you can’t putDateTime.Nowin an inner array.