Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
What is the difference between list and dictionary in C#?
Dictionary is a collection of keys and values in C#. Dictionary
List collection is a generic class and can store any data types to create a list.
A list is a group of items −
ListmyList = new List () { "Maths", "English", " Science" };
Dictionary is a set of key-value pairs.
Dictionaryd = new Dictionary (); d.Add("squash", 1); d.Add("football", 2); d.Add("rugby", 3);
Looping is easier and faster in a list and access element using index easily with a List.
Advertisements
