What is this constructor doing? new MailAddress[0]

110 Views Asked by At

I know how to use MailAddress like this: new MailAddress("[email protected]")

But what is this I'm seeing: new MailAddress[0] - how is this used and when is it ok to use? I don't see anything about this in the docs on MSDN.

1

There are 1 best solutions below

2
On BEST ANSWER

After all the comments above.... the main difference is

mailAddress mA = new mailAddress();

mA object is initialized by calling default constructor.

mailAddress[] mA1 = new mailAddress[0];

In this case, no object is initialized, it is just declaration of array of objects. No constructor calls.