

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What are the differences between a list collection and an array in C#?
List collection is a generic class and can store any data types to create a list. To define a List −
List<string> l = new List<string>();
To set elements in a list, you need to use the Add method.
l.Add("One"); l.Add("Two"); l.Add("Three");
An array stores a fixed-size sequential collection of elements of the same type.
To define Arrays −
int[] arr = new int[5];
To initialize and set elements to Arrays −
int[] arr = new int[5] {4, 8,5};
- Related Questions & Answers
- What are the differences between a dictionary and an array in C#?
- What are the differences between a multi-dimensional array and jagged array?
- What are the differences between a class and an interface in Java?
- What are the differences between an application and an applet in Java?
- What are the differences between an Integer and an int in Java?
- What are differences between a gated community and an apartment?
- What is the difference between a python list and an array?
- What is the difference between a list and an array in C#?
- Differences between Collection and Collections in Java?
- What are the differences between list, sequence and slice data types in Python?
- What are the differences between C++ and Java?
- What are the differences between C and Java?
- What are the differences between holography and photography?
- What are the differences between lodash and underscore?
- What are the differences between solvency and liquidity?
Advertisements