Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
10
Task/Collections/C-sharp/collections-1.cs
Normal file
10
Task/Collections/C-sharp/collections-1.cs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
// Creates and initializes a new integer Array
|
||||
int[] intArray = new int[5] { 1, 2, 3, 4, 5 };
|
||||
//same as
|
||||
int[] intArray = new int[]{ 1, 2, 3, 4, 5 };
|
||||
//same as
|
||||
int[] intArray = { 1, 2, 3, 4, 5 };
|
||||
|
||||
//Arrays are zero-based
|
||||
string[] stringArr = new string[5];
|
||||
stringArr[0] = "string";
|
||||
8
Task/Collections/C-sharp/collections-2.cs
Normal file
8
Task/Collections/C-sharp/collections-2.cs
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
//Create and initialize ArrayList
|
||||
ArrayList myAl = new ArrayList { "Hello", "World", "!" };
|
||||
|
||||
//Create ArrayList and add some values
|
||||
ArrayList myAL = new ArrayList();
|
||||
myAL.Add("Hello");
|
||||
myAL.Add("World");
|
||||
myAL.Add("!");
|
||||
8
Task/Collections/C-sharp/collections-3.cs
Normal file
8
Task/Collections/C-sharp/collections-3.cs
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
//Create and initialize List
|
||||
List<string> myList = new List<string> { "Hello", "World", "!" };
|
||||
|
||||
//Create List and add some values
|
||||
List<string> myList2 = new List<string>();
|
||||
myList2.Add("Hello");
|
||||
myList2.Add("World");
|
||||
myList2.Add("!");
|
||||
7
Task/Collections/C-sharp/collections-4.cs
Normal file
7
Task/Collections/C-sharp/collections-4.cs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
//Create an initialize Hashtable
|
||||
Hashtable myHt = new Hashtable() { { "Hello", "World" }, { "Key", "Value" } };
|
||||
|
||||
//Create Hashtable and add some Key-Value pairs.
|
||||
Hashtable myHt2 = new Hashtable();
|
||||
myHt2.Add("Hello", "World");
|
||||
myHt2.Add("Key", "Value");
|
||||
6
Task/Collections/C-sharp/collections-5.cs
Normal file
6
Task/Collections/C-sharp/collections-5.cs
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
//Create an initialize Dictionary
|
||||
Dictionary<string, string> dict = new Dictionary<string, string>() { { "Hello", "World" }, { "Key", "Value" } };
|
||||
//Create Dictionary and add some Key-Value pairs.
|
||||
Dictionary<string, string> dict2 = new Dictionary<string, string>();
|
||||
dict2.Add("Hello", "World");
|
||||
dict2.Add("Key", "Value");
|
||||
Loading…
Add table
Add a link
Reference in a new issue