
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 26504 Articles for Server Side Programming

137 Views
To get the object at the beginning of the Queue, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo { public static void Main() { Queue queue = new Queue(); queue.Enqueue("A"); queue.Enqueue("B"); queue.Enqueue("C"); queue.Enqueue("D"); queue.Enqueue("E"); queue.Enqueue("F"); queue.Enqueue("G"); Console.WriteLine("Count of elements = "+queue.Count); Console.WriteLine("Element at the beginning of queue = " + queue.Peek()); } }OutputThis will produce the following output −Count of elements = 7 Element at the beginning of queue = AExampleLet us see another ... Read More

119 Views
To get or set the value associated with specified key in SortedList, 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("A", "Books"); list.Add("B", "Electronics"); list.Add("C", "Appliances"); list.Add("D", "Pet Supplies"); list.Add("E", "Clothing"); list.Add("F", "Footwear"); Console.WriteLine("Value associated with key E = "+list["E"]); list["E"] = "HDD"; Console.WriteLine("Value associated with key E [Updated] = "+list["E"]); ... Read More

156 Views
To check if two StringDictionary objects are equal or not, the code is as follows −Example Live Demousing System; 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"); StringDictionary strDict2 = new StringDictionary(); strDict2.Add("A", "John"); strDict2.Add("B", "Andy"); strDict2.Add("C", "Tim"); strDict2.Add("D", ... Read More

159 Views
To check if two StringCollection objects are equal, the code is as follows −Example Live Demousing System; using System.Collections.Specialized; public class Demo { public static void Main() { StringCollection strCol1 = new StringCollection(); strCol1.Add("Accessories"); strCol1.Add("Books"); strCol1.Add("Electronics"); Console.WriteLine("StringCollection1 elements..."); foreach (string res in strCol1) { Console.WriteLine(res); } StringCollection strCol2 = new StringCollection(); strCol2.Add("Accessories"); strCol2.Add("Books"); strCol2.Add("Electronics"); Console.WriteLine("StringCollection2 elements..."); foreach ... Read More

125 Views
To get or set the value associated with specified key in ListDictionary, the code is as follows −Example Live Demousing System; using System.Collections; using System.Collections.Specialized; public class Demo { public static void Main() { ListDictionary dict = new ListDictionary(); dict.Add("A", "Books"); dict.Add("B", "Electronics"); dict.Add("C", "Appliances"); dict.Add("D", "Pet Supplies"); dict.Add("E", "Clothing"); dict.Add("F", "Footwear"); Console.WriteLine("Value associated with key C = "+dict["C"]); } }OutputThis will produce the following output −Value associated with key C = AppliancesExampleLet us see another example − Live Demousing System; using ... Read More

311 Views
To remove elements from a SortedSet that match the predicate, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo { private static bool demo(int i) { return ((i % 10) == 0); } public static void Main(String[] args) { SortedSet set1 = new SortedSet(); set1.Add(200); set1.Add(215); set1.Add(310); set1.Add(500); set1.Add(600); Console.WriteLine("SortedSet elements..."); foreach (int i in set1) { Console.WriteLine(i); } ... Read More

311 Views
To remove elements from a HashSet with conditions defined by the predicate, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo { private static bool demo(int i) { return (i == 100); } public static void Main(String[] args) { HashSet list = new HashSet(); list.Add(100); list.Add(300); list.Add(400); list.Add(500); list.Add(600); Console.WriteLine("HashSet elements..."); foreach (int i in list) { Console.WriteLine(i); } ... Read More

178 Views
To remove element at specified index of Collection, the code is as follows −Example Live Demousing System; using System.Collections.ObjectModel; public class Demo { public static void Main() { Collection col = new Collection(); col.Add("Andy"); col.Add("Kevin"); col.Add("John"); col.Add("Kevin"); col.Add("Mary"); col.Add("Katie"); col.Add("Barry"); col.Add("Nathan"); col.Add("Mark"); Console.WriteLine("Count of elements = "+ col.Count); Console.WriteLine("Iterating through the collection..."); var enumerator = col.GetEnumerator(); while (enumerator.MoveNext()) ... Read More

312 Views
To get second element of the Tuple, the code is as follows −Example Live Demousing System; public class Demo { public static void Main(String[] args) { var tuple1 = Tuple.Create(75, 200, 500, 700, 100, 1200, 1500); var tuple2 = Tuple.Create(75, 200, 500, 700, 100, 1200, 1500); Console.WriteLine("Is Tuple1 equal to Tuple2? = "+tuple1.Equals(tuple2)); Console.WriteLine("HashCode of Tuple1 = "+tuple1.GetHashCode()); Console.WriteLine("HashCode of Tuple2 = "+tuple2.GetHashCode()); Console.WriteLine("Tuple1 Item 1st = "+tuple1.Item1); Console.WriteLine("Tuple2 Item 1st = "+tuple2.Item1); Console.WriteLine("Tuple1 Item 2nd ... Read More

91 Views
To check if HybridDictionary is read only, 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