- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- 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 2628 Articles for Csharp
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
72 Views
To create an empty HybridDictionary with specified case sensitivity, the code is as follows −Example Live Demousing System; using System.Collections; using System.Collections.Specialized; public class Demo { public static void Main() { HybridDictionary myDict = new HybridDictionary(); myDict.Add("A", "AB"); myDict.Add("B", "BC"); myDict.Add("C", "DE"); myDict.Add("D", "FG"); myDict.Add("e", "fg"); Console.WriteLine("Key/Value pairs..."); foreach(DictionaryEntry de in myDict) Console.WriteLine("Key = "+de.Key + ", Value = " + de.Value); } }OutputThis will produce the following output −Key/Value pairs... Key = A, ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
80 Views
To create an empty case-sensitive HybridDictionary, the code is as follows −Example Live Demousing System; using System.Collections; using System.Collections.Specialized; public class Demo { public static void Main() { HybridDictionary dict = new HybridDictionary(false); dict.Add("A", "AB"); dict.Add("B", "BC"); dict.Add("C", "DE"); dict.Add("D", "de"); Console.WriteLine("Key/Value pairs..."); foreach(DictionaryEntry de in dict) Console.WriteLine("Key = "+de.Key + ", Value = " + de.Value); } }OutputThis will produce the following output −Key/Value pairs... Key = A, Value = AB Key = B, Value = BC Key = C, Value = DE Key = D, Value = deExampleLet us ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
91 Views
To create an ArrayList having specified initial capacity, the code is as follows −Example Live Demousing System; using System.Collections; public class Demo { public static void Main(String[] args) { ArrayList list1 = new ArrayList(5); list1.Add("A"); list1.Add("B"); list1.Add("C"); list1.Add("D"); Console.WriteLine("Capacity in ArrayList1 = "+list1.Capacity); Console.WriteLine("Elements in ArrayList1..."); foreach (string res in list1) { Console.WriteLine(res); } ArrayList list2 = new ArrayList(10); list2.Add("A"); ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
68 Views
To create a synchronized wrapper for the Hashtable, the code is as follows −Example Live Demousing System; using System.Collections; public class Demo { public static void Main() { Hashtable hash = new Hashtable(); hash.Add("1", "AB"); hash.Add("2", "CD"); hash.Add("3", "EF"); hash.Add("4", "GH"); hash.Add("5", "IJ"); hash.Add("6", "KL"); Console.WriteLine("Hashtable elements..."); foreach(DictionaryEntry d in hash) { Console.WriteLine("Key = "+d.Key + ", Value = " + d.Value); } ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
82 Views
To create a synchronized wrapper for the ArrayList, the code is as follows −Example Live Demousing System; using System.Collections; public class Demo { public static void Main() { ArrayList arrList = new ArrayList(); arrList.Add("AB"); arrList.Add("CD"); arrList.Add("EF"); arrList.Add("GH"); arrList.Add("IJ"); arrList.Add("KL"); Console.WriteLine("ArrayList elements..."); foreach(string str in arrList) { Console.WriteLine(str); } Console.WriteLine("ArrayList is synchronized? = "+arrList.IsSynchronized); } }OutputThis will produce the following output −ArrayList elements... AB ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
139 Views
To check if the ArrayList has a fixed size, the code is as follows −Example Live Demousing System; using System.Collections; public class Demo { public static void Main(String[] args) { ArrayList list1 = new ArrayList(); list1.Add("One"); list1.Add("Two"); list1.Add("Three"); list1.Add("Four"); list1.Add("Five"); Console.WriteLine("Elements in ArrayList..."); foreach (string res in list1) { Console.WriteLine(res); } ArrayList list = ArrayList.Synchronized(list1); Console.WriteLine("Is ArrayList synchronized? = "+list.IsSynchronized); ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
198 Views
To check if ArrayList is synchronized, the code is as follows −Example Live Demousing System; using System.Collections; public class Demo { public static void Main(String[] args) { ArrayList list1 = new ArrayList(); list1.Add("A"); list1.Add("B"); list1.Add("C"); list1.Add("D"); list1.Add("E"); list1.Add("F"); list1.Add("G"); list1.Add("H"); list1.Add("I"); Console.WriteLine("Elements in ArrayList1..."); foreach (string res in list1) { Console.WriteLine(res); } ArrayList list2 ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
60 Views
To check if StringDictionary is synchronized, the code is as follows −Example Live Demousing System; using System.Collections; using System.Collections.Specialized; public class Demo { public static void Main() { StringDictionary strDict1 = new StringDictionary(); strDict1.Add("A", "John"); strDict1.Add("B", "Andy"); strDict1.Add("C", "Tim"); strDict1.Add("D", "Ryan"); strDict1.Add("E", "Kevin"); strDict1.Add("F", "Katie"); strDict1.Add("G", "Brad"); Console.WriteLine("StringDictionary1 elements..."); foreach(DictionaryEntry de in strDict1) { Console.WriteLine(de.Key + " " + de.Value); } ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
74 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
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
91 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