
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

203 Views
To search for an element matching the conditions and return the zero-based index of the last occurrence within the entire List, 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) { List list = new List(); list.Add(200); list.Add(215); list.Add(310); list.Add(500); list.Add(600); Console.WriteLine("List elements..."); foreach (int i in ... Read More

157 Views
To search the index of specified object in Collection, the code is as follows −Example Live Demousing System; using System.Collections.Specialized; public class Demo { public static void Main() { StringCollection strCol = new StringCollection(); strCol.Add("Accessories"); strCol.Add("Books"); strCol.Add("Electronics"); strCol.Add("Books"); Console.WriteLine("StringCollection elements..."); foreach (string res in strCol) { Console.WriteLine(res); } strCol.Insert(2, "Headphone"); Console.WriteLine("StringCollection elements...UPDATED"); foreach (string res in strCol) { Console.WriteLine(res); ... Read More

98 Views
To get the number of elements contained in the BitArray, the code is as follows −Example Live Demousing System; using System.Collections; public class Demo { public static void Main() { BitArray arr1 = new BitArray(5); BitArray arr2 = new BitArray(5); arr1[0] = false; arr1[1] = false; arr2[0] = false; arr2[1] = true; Console.WriteLine("BitArray1 elements..."); foreach (bool res in arr1) { Console.WriteLine(res); } Console.WriteLine("BitArray2 elements..."); ... Read More

586 Views
To check whether a thread is alive or not, the code is as follows −Example Live Demousing System; using System.Threading; public class Demo { public static void Main() { Thread thread = new Thread(new ThreadStart(demo1)); thread = Thread.CurrentThread; Console.WriteLine("Is the thread alive? = "+thread.IsAlive); ThreadPool.QueueUserWorkItem(new WaitCallback(demo2)); Console.WriteLine("Current state of Thread = "+thread.ThreadState); Console.WriteLine("ManagedThreadId = "+thread.ManagedThreadId); thread.IsBackground = true; Console.WriteLine("Is the Thread a background thread? = "+thread.IsBackground); } public static void demo1() { ... Read More

194 Views
To search in a SortedList object, 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: {0}, Value: {1}", k.Key , k.Value ... Read More

228 Views
To check whether a thread is a background thread or not, the code is as follows −Example Live Demousing System; using System.Threading; public class Demo { public static void Main() { Thread thread = new Thread(new ThreadStart(demo1)); ThreadPool.QueueUserWorkItem(new WaitCallback(demo2)); Console.WriteLine("Current state of Thread = "+thread.ThreadState); Console.WriteLine("ManagedThreadId = "+thread.ManagedThreadId); Console.WriteLine("Is the Thread a background thread? = "+Thread.CurrentThread.IsBackground); } public static void demo1() { Thread.Sleep(2000); } public static void demo2(object stateInfo) { Console.WriteLine("Thread belongs to managed thread ... Read More

232 Views
To get the number of elements in HashSet in C#, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo { public static void Main() { HashSet set1 = new HashSet(); set1.Add(25); set1.Add(50); set1.Add(75); set1.Add(100); set1.Add(125); set1.Add(150); Console.WriteLine("Elements in HashSet1"); foreach(int val in set1) { Console.WriteLine(val); } Console.WriteLine("Number of elements in HashSet1 = "+set1.Count); HashSet set2 ... Read More

126 Views
To remove the specified node from 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(100); list.AddLast(200); list.AddLast(300); list.AddLast(400); list.AddLast(500); list.AddLast(300); list.AddLast(500); Console.WriteLine("LinkedList elements..."); foreach(int i in list) { Console.WriteLine(i); } LinkedListNode val = list.FindLast(300); Console.WriteLine("Specified value = "+val.Value); ... Read More

190 Views
To set the bit a specific position in the BitArray to the specified values, the code is as follows −Example Live Demousing System; using System.Collections; public class Demo { public static void Main() { BitArray arr = new BitArray(5); arr[0] = true; arr[1] = false; arr[2] = true; arr[3] = false; Console.WriteLine("BitArray..."); foreach(Object ob in arr) { Console.WriteLine(ob); } arr.Set(2, false); Console.WriteLine("Updated BitArray..."); ... Read More

392 Views
The ListDictionary class implements IDictionary using a singly linked list. It is recommended for collections that typically include fewer than 10 items.Following are the properties of ListDictionary class −Sr.NoProperty & Description1CountGets the number of key/value pairs contained in the ListDictionary.2IsFixedSizeGets a value indicating whether the ListDictionary has a fixed size.3IsReadOnlyGets a value indicating whether the ListDictionary is readonly.4IsSynchronizedGets a value indicating whether the ListDictionary is synchronized (thread safe).5Item[Object]Gets or sets the value associated with the specified.6KeysGets an ICollection containing the keys in the ListDictionary.7SyncRootGets an object that can be used to synchronize access to the ListDictionary.8ValuesGets an ICollection containing the ... Read More