When to use the NEW[] keyword RRS feed

  • Question

  • User2124874475 posted


    I'm new to ASP and C# programming but have some experience in VB.

    Maybe someone can help me with this.  I think I know how this works but I wanted some clarity.

    If I use the NEW keyword with two brackets [] as in the following example, does it mean that the parameters I am passing are generic, or considered somehow separate from the originals?

    Roles.AddUsersToRole(new[]{username}, new[]{"Seller"});

    Or can you tell me why I would use the NEW[] parameter versus just passing the variables?

    Thanks in advance.


    Saturday, August 30, 2014 10:18 PM


All replies