The difference between int [] and list <int>
5 answers
On the wire, they will be indistinguishable - i.e. both Customer[] and List<Customer> will look (approximately) like this:
<Customers> <Customer name="Fred" ... /> <Customer name="Barney" ... /> </Customers> Thus, it makes no sense to have logic that treats the two differently. Ultimately, int[] is a pain to work with ( Add , etc.), so I would use List<T> - of course, wsdl.exe good by default for arrays, IIRC - but there is a command line switch (or maybe for wse / wcf).
+7
int [] is an array of integers. A list is a general list containing objects of type int
Which one you choose depends on your requirements. If you are dealing with immutable sets of objects, then int [] would be more appropriate. However, if you need to modify the contents of a collection, List provides such flexibility.
0