
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

275 Views
To copy the elements of the collection over a range of elements in 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("A"); arrList.Add("B"); arrList.Add("C"); arrList.Add("D"); Console.WriteLine("ArrayList elements..."); for (int i = 0; i < arrList.Count; i++) { Console.WriteLine("" + arrList[i]); } string[] str = { "Demo", "Text" }; arrList.SetRange(0, ... Read More

128 Views
To copy StringDictionary to Array at the specified index, the code is as follows −Example Live Demousing System; using System.Collections; using System.Collections.Specialized; public class Demo { public static void Main(){ StringDictionary strDict = new StringDictionary(); strDict.Add("1", "SUV"); strDict.Add("2", "AUV"); strDict.Add("3", "Electric Car"); strDict.Add("4", "Utility Vehicle"); strDict.Add("5", "Hatchback"); strDict.Add("6", "Compact car"); strDict.Add("7", "MUV"); strDict.Add("8", "Crossover"); strDict.Add("9", "Covertible"); strDict.Add("10", "Quadricycle"); DictionaryEntry[] arr = { new DictionaryEntry(), ... Read More

122 Views
To copy StringCollection at the specified index of the array, the code is as follows −Example Live Demousing System; using System.Collections.Specialized; public class Demo { public static void Main(){ StringCollection strCol = new StringCollection(); String[] strArr = new String[] { "Tim", "Tom", "Sam", "Mark", "Katie", "Jacob"}; Console.WriteLine("Elements..."); for (int i = 0; i < strArr.Length; i++) { Console.WriteLine(strArr[i]); } strCol.AddRange(strArr); String[] arr = new String[strCol.Count]; strCol.CopyTo(arr, 0); Console.WriteLine("Elements...after copying ... Read More

139 Views
To copy OrderedDictionary elements to Array instance at the specified index, 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, "Harry"); dict.Add(2, "Mark"); dict.Add(3, "John"); dict.Add(4, "Jacob"); dict.Add(5, "Tim"); Console.WriteLine("OrderedDictionary elements..."); foreach(DictionaryEntry d in dict){ Console.WriteLine(d.Key + " " + d.Value); } DictionaryEntry[] dictArr = new DictionaryEntry[dict.Count]; ... Read More

95 Views
To copy ListDictionary to Array instance at the specified index, 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(1, "Harry"); dict.Add(2, "Mark"); dict.Add(3, "John"); dict.Add(4, "Jacob"); dict.Add(5, "Tim"); dict.Add(6, "Sam"); dict.Add(7, "Tom"); dict.Add(8, "Kevin"); Console.WriteLine("ListDictionary elements..."); foreach(DictionaryEntry d in dict){ Console.WriteLine(d.Key + " " + ... Read More

103 Views
To add the specified key and value into 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(); dict.Add("A", "Bags"); dict.Add("B", "Electronics"); dict.Add("C", "Smart Wearables"); dict.Add("D", "Pet Supplies"); Console.WriteLine("HybridDictionary elements..."); foreach(DictionaryEntry d in dict){ Console.WriteLine(d.Key + " " + d.Value); } Console.WriteLine("Is the HybridDictionary having fixed size? = "+dict.IsFixedSize); ... Read More

102 Views
To add elements of the specified collection to the end of 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("Andy"); list.Add("Gary"); list.Add("Katie"); list.Add("Amy"); Console.WriteLine("Elements in List..."); foreach (string res in list){ Console.WriteLine(res); } string[] strArr = { "John", "Jacob" }; list.AddRange(strArr); Console.WriteLine("Elements in List...UPDATED"); ... Read More

167 Views
To add new node or value at the start 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); } list.AddLast("G"); ... Read More

107 Views
To check if OrderedDictionary collection 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(){ OrderedDictionary dict = new OrderedDictionary(); dict.Add("1", "One"); dict.Add("2", "Two"); dict.Add("3", "Three"); dict.Add("4", "Four"); dict.Add("5", "Five"); dict.Add("6", "Six"); dict.Add("7", "Seven"); dict.Add("8", "Eight"); ICollection col = dict.Values; String[] strVal = new String[dict.Count]; col.CopyTo(strVal, 0); Console.WriteLine("Displaying ... Read More

210 Views
To convert the value of the specified Decimal to the equivalent 16-bit unsigned integer, the code is as follows −Example Live Demousing System; public class Demo { public static void Main() { Decimal val = 875.647m; Console.WriteLine("Decimal value = "+val); ushort res = Decimal.ToUInt16(val); Console.WriteLine("16-bit unsigned integer = "+res); } }OutputThis will produce the following output −Decimal value = 875.647 16-bit unsigned integer = 875ExampleLet us see another example − Live Demousing System; public class Demo { public static void Main() { Decimal val = 0.001m; Console.WriteLine("Decimal value ... Read More