
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
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
Found 2587 Articles for Csharp

155 Views
To check if a SortedList object is synchronized, the code is as follows −Example Live Demousing System; using System.Collections; public class Demo { public static void Main() { SortedList list = new SortedList(); list.Add("1", "One"); list.Add("2", "Two"); list.Add("3", "Three"); list.Add("4", "Four"); list.Add("5", "Five"); list.Add("6", "Six"); list.Add("7", "Seven"); list.Add("8", "Eight"); Console.WriteLine("Key and Value of SortedList...."); foreach(DictionaryEntry k in list ) Console.WriteLine("Key: ... Read More

197 Views
To check if ListDictionary has a fixed size, the code is as follows −Example Live Demousing System; using System.Collections; using System.Collections.Specialized; public class Demo { public static void Main() { ListDictionary dict1 = new ListDictionary(); dict1.Add("A", "Books"); dict1.Add("B", "Electronics"); dict1.Add("C", "Smart Wearables"); dict1.Add("D", "Pet Supplies"); dict1.Add("E", "Clothing"); dict1.Add("F", "Footwear"); Console.WriteLine("ListDictionary1 elements..."); foreach(DictionaryEntry d in dict1) { Console.WriteLine(d.Key + " " + d.Value); } ... Read More

122 Views
To check if ListDictionary contains a specific key, the code is as follows −Example Live Demousing System; using System.Collections; using System.Collections.Specialized; public class Demo { public static void Main() { ListDictionary dict1 = new ListDictionary(); dict1.Add("A", "Books"); dict1.Add("B", "Electronics"); dict1.Add("C", "Smart Wearables"); dict1.Add("D", "Pet Supplies"); dict1.Add("E", "Clothing"); dict1.Add("F", "Footwear"); Console.WriteLine("ListDictionary1 elements..."); foreach(DictionaryEntry d in dict1) { Console.WriteLine(d.Key + " " + d.Value); } ... Read More

387 Views
To get an enumerator that iterates through HashSet, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo { public static void Main(String[] args) { HashSet set1 = new HashSet(); set1.Add("A"); set1.Add("B"); set1.Add("C"); set1.Add("D"); set1.Add("E"); set1.Add("F"); set1.Add("G"); set1.Add("H"); Console.WriteLine("Elements in HashSet1..."); foreach (string res in set1) { Console.WriteLine(res); } HashSet set2 = new ... Read More

263 Views
To get the number of nodes contained in the LinkedList, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo { public static void Main() { LinkedList list = new LinkedList(); list.AddLast("A"); list.AddLast("B"); list.AddLast("C"); list.AddLast("D"); list.AddLast("E"); list.AddLast("F"); list.AddLast("G"); list.AddLast("H"); list.AddLast("I"); list.AddLast("J"); Console.WriteLine("Count of nodes = " + list.Count); Console.WriteLine("First Node = "+list.First.Value); list.Clear(); ... Read More

120 Views
To check if HybridDictionary has fixed size, the code is as follows −Example Live Demousing System; using System.Collections; using System.Collections.Specialized; public class Demo { public static void Main() { HybridDictionary dict1 = new HybridDictionary(); dict1.Add("A", "Books"); dict1.Add("B", "Electronics"); dict1.Add("C", "Smart Wearables"); dict1.Add("D", "Pet Supplies"); dict1.Add("E", "Clothing"); dict1.Add("F", "Footwear"); Console.WriteLine("HybridDictionary1 elements..."); foreach(DictionaryEntry d in dict1) { Console.WriteLine(d.Key + " " + d.Value); } Console.WriteLine("Is ... Read More

155 Views
To add new node or value at the end of LinkedList, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo { public static void Main() { LinkedList list = new LinkedList(); list.AddLast("A"); list.AddLast("B"); list.AddLast("C"); list.AddLast("D"); list.AddLast("E"); list.AddLast("F"); Console.WriteLine("Count of nodes = " + list.Count); Console.WriteLine("Elements in LinkedList..."); foreach (string res in list) { Console.WriteLine(res); } ... Read More

211 Views
To add elements to the end of the ArrayList, the code is as follows −Example Live Demousing System; using System.Collections; public class Demo { public static void Main(String[] args) { ArrayList list = new ArrayList(); list.Add("Andy"); list.Add("Gary"); list.Add("Katie"); list.Add("Amy"); Console.WriteLine("Elements in ArrayList..."); foreach (string res in list) { Console.WriteLine(res); } string[] strArr = { "John", "Jacob" }; list.AddRange(strArr); Console.WriteLine("Elements in ArrayList...UPDATED"); ... Read More

261 Views
To add an element to the List, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo { public static void Main(String[] args) { List list = new List(); list.Add("One"); list.Add("Two"); list.Add("Three"); list.Add("Four"); list.Add("Five"); list.Add("Six"); list.Add("Seven"); list.Add("Eight"); Console.WriteLine("Enumerator iterates through the list elements..."); List.Enumerator demoEnum = list.GetEnumerator(); while (demoEnum.MoveNext()) { string res = demoEnum.Current; ... Read More

148 Views
To check if SortedDictionary contains the specified key or not, the code is as follows −Example Live Demousing System; using System.Collections; using System.Collections.Generic; public class Demo { public static void Main() { SortedDictionary sortedDict = new SortedDictionary(); sortedDict.Add(100, "Mobile"); sortedDict.Add(200, "Laptop"); sortedDict.Add(300, "Desktop"); sortedDict.Add(400, "Speakers"); sortedDict.Add(500, "Headphone"); sortedDict.Add(600, "Earphone"); Console.WriteLine("SortedDictionary key-value pairs..."); IDictionaryEnumerator demoEnum = sortedDict.GetEnumerator(); while (demoEnum.MoveNext()) Console.WriteLine("Key = " + demoEnum.Key + ", Value = ... Read More