
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 2587 Articles for Csharp

94 Views
The Stack.IsSynchronized property in C# is used to get a value indicating whether access to the Stack is synchronized (thread safe).SyntaxThe syntax is as follows −public virtual bool IsSynchronized { get; }ExampleLet us now see an example − Live Demousing System; using System.Collections; public class Demo { public static void Main() { Stack stack = new Stack(); stack.Push("Inspiron"); stack.Push("Alienware"); stack.Push("Projectors"); stack.Push("Monitors"); stack.Push("XPS"); stack.Push("Laptop"); stack.Push("Notebook"); Console.WriteLine("Stack elements..."); foreach(string val in stack) ... Read More

340 Views
The Double.Equals() method in C# is used to return a value indicating whether two instances of Double represent the same value.SyntaxThe syntax is as follows −public bool Equals (double obj); public override bool Equals (object ob);The obj parameter of the first syntax is a Double object to compare to this instance, whereas the obj of the second parameter is an object to compare with this instance.ExampleLet us now see an example − Live Demousing System; public class Demo { public static void Main() { double d1 = 150d; double d2 = 150d; ... Read More

2K+ Views
The Double.CompareTo() method in C# is used to compare this instance to a specified object or Double object and returns an integer that indicates whether the value of this instance is less than, equal to, or greater than the value of the specified object or Double object.SyntaxThe syntax is as follows −public int CompareTo (double val); public int CompareTo (object val);Above, the value val in the 1st syntax is a double-precision floating-point number to compare, whereas val for the 2nd syntax is an object to compare.ExampleLet us now see an example − Live Demousing System; public class Demo { public static void Main() { ... Read More

516 Views
The Boolean.ToString() method in C# is used to convert the value of this instance to its equivalent string representation.SyntaxThe syntax is as follows −public string ToString (IFormatProvider provider);Above, the parameter provider is an IFormatProvider object.ExampleLet us now see an example − Live Demousing System; using System.Globalization; public class Demo { public static void Main(String[] args) { bool val1 = true; bool val2 = false; Console.WriteLine("Value1 (Hashcode) = "+val1.GetHashCode()); Console.WriteLine("Value1 (TypeCode) = "+val1.GetTypeCode()); Console.WriteLine("Value2 (Hashcode) = "+val2.GetHashCode()); Console.WriteLine("Value2 (TypeCode) = "+val2.GetTypeCode()); ... Read More

318 Views
The Stack.Count property in C# is used to get the number of elements contained in the Stack.SyntaxThe syntax is as follows −public virtual int Count { get; }ExampleLet us now see an example − Live Demousing System; using System.Collections; public class Demo { public static void Main() { Stack stack = new Stack(); stack.Push("Inspiron"); stack.Push("Alienware"); stack.Push("Projectors"); stack.Push("Monitors"); stack.Push("XPS"); stack.Push("Laptop"); stack.Push("Notebook"); Console.WriteLine("Stack elements..."); foreach(string val in stack) { ... Read More

218 Views
The Stack.Contains() method in C# is used to check whether an element is in the Stack or not.SyntaxThe syntax is as follows −public virtual bool Contains (object ob);Above, ob is the object to be searched in the stack.ExampleLet us now see an example − Live Demousing System; using System.Collections; public class Demo { public static void Main() { Stack stack = new Stack(); stack.Push("Inspiron"); stack.Push("Alienware"); stack.Push("Projectors"); stack.Push("Monitors"); stack.Push("XPS"); stack.Push("Laptop"); stack.Push("Notebook"); Console.WriteLine("Stack elements..."); ... Read More

586 Views
The TimeSpan.FromMilliseconds() method in C# is used to return a TimeSpan that represents a specified number of milliseconds.The syntax is as follows −Syntaxpublic static TimeSpan FromMilliseconds (double val);Above, val is the number of milliseconds.ExampleLet us now see an example − Live Demousing System; public class Demo { public static void Main() { TimeSpan span1 = TimeSpan.FromDays(15); TimeSpan span2 = new TimeSpan(5, 15, 30); TimeSpan span3 = TimeSpan.FromHours(5); TimeSpan span4 = TimeSpan.FromMilliseconds(876876876.1); Console.WriteLine("TimeSpan1 = "+span1); Console.WriteLine("TimeSpan2 = "+span2); Console.WriteLine("TimeSpan3 = ... Read More

191 Views
The String.IsNormalized() method in C# is used to indicate whether this string is in a particular Unicode normalization form.SyntaxThe syntax is as follows −public bool IsNormalized (); public bool IsNormalized (System.Text.NormalizationForm normalizationForm);Above, the parameter normalizationForm is a Unicode normalization form.ExampleLet us now see an example − Live Demousing System; public class Demo { public static void Main(String[] args) { string str1 = "Ryan"; string str2 = "Matt"; Console.WriteLine("String 1 = "+str1); Console.WriteLine("HashCode of String 1 = "+str1.GetHashCode()); Console.WriteLine("Index of character 'k' in str1 = " ... Read More

812 Views
The Queue.Dequeue() method in C# is used to remove and return the object at the beginning of the Queue.SyntaxThe syntax is as follows −public virtual object Dequeue ();ExampleLet us now see an 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 ... Read More

171 Views
The Queue.Count property in C# is used to get the number of elements contained in the Queue.SyntaxThe syntax is as follows −public virtual int Count { get; }ExampleLet us now see an example − Live Demousing System; using System.Collections.Generic; public class Demo { public static void Main() { Queue queue = new Queue(); queue.Enqueue(100); queue.Enqueue(200); queue.Enqueue(300); queue.Enqueue(400); queue.Enqueue(500); queue.Enqueue(600); queue.Enqueue(700); queue.Enqueue(800); queue.Enqueue(900); queue.Enqueue(1000); Console.WriteLine("Queue..."); ... Read More