Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Server Side Programming Articles
Page 702 of 2109
Stack.IsSynchronized Property in C#
The Stack.IsSynchronized property in C# is used to get a value indicating whether access to the Stack is synchronized (thread-safe). This property returns false for the standard Stack class, as it is not thread-safe by default. Syntax Following is the syntax of the IsSynchronized property − public virtual bool IsSynchronized { get; } Return Value This property returns true if the Stack is synchronized (thread-safe); otherwise, it returns false. For the default Stack implementation, this property always returns false. Understanding Thread Safety in Stack The standard Stack class is not thread-safe, ...
Read MoreStack.Peek() Method in C#
The Stack.Peek() method in C# is used to return the object at the top of the Stack without removing it. This method is essential when you need to examine the top element while keeping the stack structure intact. Syntax Following is the syntax for the Stack.Peek() method − public virtual object Peek(); Return Value The method returns the object at the top of the Stack. If the stack is empty, it throws an InvalidOperationException. Stack.Peek() Operation Item 3 ...
Read MoreC# Int16 Struct
The Int16 Struct in C# represents a 16-bit signed integer with values ranging from -32, 768 to 32, 767. It is also commonly known as the short data type and is part of the .NET value types that directly inherit from System.ValueType. Int16 Value Range -32, 768 MinValue 0 32, 767 MaxValue Fields The Int16 struct provides two important constant fields − ...
Read MoreC# Int32 Struct
The Int32 struct in C# represents a 32-bit signed integer. It is an immutable value type that represents signed integers with values ranging from -2, 147, 483, 648 to 2, 147, 483, 647. The int keyword in C# is an alias for Int32. This struct provides various fields and methods for working with 32-bit integers, including comparison, parsing, and conversion operations. Syntax Following is the syntax for declaring an Int32 variable − int variableName = value; Int32 variableName = value; Fields The Int32 struct provides two important constant fields − ...
Read MoreC# Int16.ToString() Method
The Int16.ToString() method in C# is used to convert a 16-bit signed integer (short) to its equivalent string representation. This method provides multiple overloads to format the output string according to your specific requirements. Syntax Following are the different overloads of the Int16.ToString() method − public override string ToString(); public string ToString(string format); public string ToString(IFormatProvider provider); public string ToString(string format, IFormatProvider provider); Parameters format − A numeric format string that specifies the format of the return value. provider − An object that supplies culture-specific formatting information. ...
Read MoreSingle.GetTypeCode Method in C# with Examples
The Single.GetTypeCode() method in C# is used to return the TypeCode for the Single value type (also known as float). This method is inherited from the IConvertible interface and always returns TypeCode.Single for any float value. Syntax Following is the syntax for the Single.GetTypeCode() method − public TypeCode GetTypeCode(); Return Value This method returns TypeCode.Single, which is an enumerated constant representing the Single data type. Using GetTypeCode with Different Float Values Example using System; public class Demo { public static void Main() { ...
Read MoreSByte.GetTypeCode Method in C# with Examples
The SByte.GetTypeCode() method in C# is used to return the TypeCode enumeration value for the sbyte data type. This method is part of the IConvertible interface and helps identify the specific type of a value at runtime. Syntax Following is the syntax for the SByte.GetTypeCode() method − public TypeCode GetTypeCode(); Return Value The method returns TypeCode.SByte, which is the enumeration constant representing the sbyte type. Using GetTypeCode() with SByte Values Example using System; public class Demo { public static void Main() { ...
Read MoreQueue.IsSynchronized Property in C#
The Queue.IsSynchronized property in C# is used to determine whether access to the Queue is synchronized, meaning it is thread-safe for concurrent access by multiple threads. Syntax Following is the syntax for the IsSynchronized property − public virtual bool IsSynchronized { get; } Return Value The property returns a bool value − true − if access to the Queue is synchronized (thread-safe) false − if access to the Queue is not synchronized Using IsSynchronized with Regular Queue By default, a regular Queue is not synchronized and returns false ...
Read MoreQueue.Peek Method in C#
The Queue.Peek() method in C# is used to return the object at the beginning of the Queue without removing it. This method is useful when you need to examine the first element in the queue without modifying the queue's contents. Syntax Following is the syntax for the non-generic Queue − public virtual object Peek(); Following is the syntax for the generic Queue − public T Peek(); Return Value The method returns the object at the beginning of the Queue. For generic queues, it returns type T, and for non-generic ...
Read MoreSingle.IsNaN() Method in C# with Examples
The Single.IsNaN() method in C# is used to determine whether a specified float value is not a number (NaN). This method returns true if the value is NaN, and false otherwise. NaN typically results from undefined mathematical operations like dividing zero by zero. Syntax Following is the syntax for the Single.IsNaN() method − public static bool IsNaN(float f); Parameters f − A single-precision floating-point number to be tested. Return Value Returns true if the value is NaN (Not a Number), otherwise false. ...
Read More