AmitDiwan has Published 10744 Articles

Get object at the top of the Stack in C#

AmitDiwan

AmitDiwan

Updated on 06-Dec-2019 12:19:47

318 Views

To get object at the top of the Stack, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo {    public static void Main() {       Stack stack = new Stack();       stack.Push("A");       stack.Push("B");       stack.Push("C");   ... Read More

Get an IDictionaryEnumerator object in OrderedDictionary in C#

AmitDiwan

AmitDiwan

Updated on 06-Dec-2019 12:14:19

132 Views

To get an IDictionaryEnumerator object in OrderedDictionary, the code is as follows −Example Live Demousing System; using System.Collections; using System.Collections.Specialized; public class Demo {    public static void Main() {       OrderedDictionary dict = new OrderedDictionary();       dict.Add("1", "One");       dict.Add("2", "Two");       ... Read More

Check if SortedSet and the specified collection contain the same elements in C#

AmitDiwan

AmitDiwan

Updated on 06-Dec-2019 12:02:47

110 Views

To check if SortedSet and the specified collection contain the same elements, the code is as follows −Exampleusing System; using System.Collections.Generic; public class Demo {    public static void Main() {       SortedSet set1 = new SortedSet();       set1.Add(100);       set1.Add(200);       ... Read More

Getting the Values in a SortedList object in C#

AmitDiwan

AmitDiwan

Updated on 06-Dec-2019 11:59:40

120 Views

To get the values in a SortedList object, the code is as follows −Exampleusing System; using System.Collections; public class Demo {    public static void Main(String[] args) {       SortedList list = new SortedList();       list.Add(1, "One");       list.Add(2, "Two");       list.Add(3, ... Read More

Getting the value at the specified index of a SortedList object in C#

AmitDiwan

AmitDiwan

Updated on 06-Dec-2019 11:55:44

111 Views

To get the value at the specified index of a SortedList object, the code is as follows −Example Live Demousing System; using System.Collections; public class Demo {    public static void Main(String[] args) {       SortedList list = new SortedList();       list.Add("A", "Jacob");       list.Add("B", ... Read More

Check if the ArrayList is read-only in C#

AmitDiwan

AmitDiwan

Updated on 06-Dec-2019 11:50:58

156 Views

To check if the ArrayList is read-only, 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("ABC");       list1.Add("BCD");       list1.Add("CDE");     ... Read More

Creating an empty HybridDictionary with specified case sensitivity in C#

AmitDiwan

AmitDiwan

Updated on 06-Dec-2019 11:46:41

136 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");   ... Read More

Creating an empty case-sensitive HybridDictionary Class in C#

AmitDiwan

AmitDiwan

Updated on 06-Dec-2019 11:42:51

109 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", ... Read More

Creating an ArrayList having specified initial capacity in C#

AmitDiwan

AmitDiwan

Updated on 06-Dec-2019 11:37:24

155 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");   ... Read More

Creating a synchronized wrapper for the Hashtable in C#

AmitDiwan

AmitDiwan

Updated on 06-Dec-2019 11:32:12

134 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", ... Read More

Advertisements