I think Joe has pretty much covered it but here is my 2 cents.  New Object
creates a new object...duh.  The Add method expects an object.  New object
returns an object.

On 4/9/09, Mike <[email protected]> wrote:
>
>
> Hi,
> Here is a really basic question that I am struggling with. What is the
> difference between the following lines:
>
> DataGrid.Rows.Add(new Object[] { "Theodore", "Roosevelt",
> "President" });
> and
> DataGrid.Rows.Add("Theodore", "Roosevelt", "President" );
>
> I am working with a data grid view in C# and both lines compile and
> appear to do the same thing functionally when run. I assume specifying
> new Object[]  is a type cast of some sort and not really needed in
> this case?
>
> The specific question I guess is if the program works without the new
> Object[] why would I want to put it there?
>
> Thanks in advance.
> Mike
>

Reply via email to