Programming Articles

Page 50 of 2547

Check if HybridDictionary has fixed size in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 164 Views

The HybridDictionary class in C# is a specialized collection that combines the performance benefits of both ListDictionary and Hashtable. To check if a HybridDictionary has a fixed size, you can use the IsFixedSize property, which returns false for standard HybridDictionary instances since they are dynamically resizable. Syntax Following is the syntax for checking if a HybridDictionary has a fixed size − bool isFixed = hybridDictionary.IsFixedSize; HybridDictionary Properties The HybridDictionary class provides several properties to check its characteristics − IsFixedSize − Returns true if the dictionary has a fixed size; otherwise, false ...

Read More

What is the difference between Finalize and Dispose in C#?

Nizamuddin Siddiqui
Nizamuddin Siddiqui
Updated on 17-Mar-2026 3K+ Views

The Finalize and Dispose methods in C# are both used for cleaning up resources, but they work differently and serve distinct purposes in memory management. Understanding their differences is crucial for proper resource management in .NET applications. Finalize Method The Finalize() method is called automatically by the Garbage Collector before an object eligible for collection is reclaimed. The Garbage Collector takes responsibility for deallocating memory for unreferenced objects. This method is called at some point after there are no longer valid references to that object in memory. The framework does not guarantee when this will happen. While ...

Read More

How to populate XDocument from String in C#?

Nizamuddin Siddiqui
Nizamuddin Siddiqui
Updated on 17-Mar-2026 2K+ Views

XML is a self-describing language that provides data along with rules to identify what information it contains. The XDocument class in C# contains all the information necessary for a valid XML document, including XML declarations, processing instructions, and comments. The XDocument class is available in the System.Xml.Linq namespace and derives from XContainer, allowing it to contain child nodes. However, XDocument objects can have only one child XElement node, reflecting the XML standard that permits only one root element per document. Syntax Following is the syntax to populate XDocument from a string using XDocument.Parse() − XDocument ...

Read More

What is Facade and how to implement in C#?

Nizamuddin Siddiqui
Nizamuddin Siddiqui
Updated on 17-Mar-2026 209 Views

The Facade design pattern provides a simplified interface to a complex subsystem. It acts as a wrapper that hides the complexity of multiple classes and their interactions behind a single, easy-to-use interface. This pattern is particularly useful when working with complex APIs, legacy systems, or when you need to provide a unified interface to a set of interfaces in a subsystem. Key Components The Facade pattern consists of the following components − Facade: The main interface that clients interact with. It delegates requests to appropriate subsystem objects. Subsystems: The complex classes that ...

Read More

UInt32.CompareTo() Method in C# with Examples

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 396 Views

The UInt32.CompareTo() method in C# is used to compare the current instance to a specified object or UInt32 and returns an indication of their relative values. This method is essential for sorting operations and determining the ordering relationship between unsigned 32-bit integers. Syntax The UInt32.CompareTo() method has two overloads − public int CompareTo(object value); public int CompareTo(uint value); Parameters value (object) − An object to compare, or null. value (uint) − An unsigned integer to compare. Return Value The method returns an int that indicates the relative order of ...

Read More

Get the number of nodes contained in LinkedList in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 309 Views

In C#, the LinkedList class provides the Count property to get the number of nodes contained in the LinkedList. This property returns an integer representing the total number of elements in the collection. Syntax Following is the syntax to get the count of nodes in a LinkedList − int count = linkedList.Count; Return Value The Count property returns an int value representing the number of nodes currently present in the LinkedList. LinkedList Node Count Node A Node B ...

Read More

Reverse the order of the elements in the entire List or in the specified range in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 314 Views

The List.Reverse() method in C# allows you to reverse the order of elements in a List. You can reverse the entire list or reverse a specific range of elements within the list. Syntax Following is the syntax for reversing the entire list − list.Reverse(); Following is the syntax for reversing a specified range of elements − list.Reverse(int index, int count); Parameters index − The zero-based starting index of the range to reverse. count − The number of elements in the range to reverse. ...

Read More

What is the difference between List and IList in C#?

Nizamuddin Siddiqui
Nizamuddin Siddiqui
Updated on 17-Mar-2026 20K+ Views

The main difference between List and IList in C# is that List is a concrete class that implements the list functionality, while IList is an interface that defines the contract for list operations. The IList interface inherits from both ICollection and IEnumerable interfaces. List and IList both represent collections of objects that can be accessed by index. They provide methods to insert, remove, search, and sort elements. The key distinction is that List is a specific implementation while IList is a contract that multiple classes can implement. Key Differences List IList ...

Read More

UInt32.Equals() Method in C# with Examples

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 187 Views

The UInt32.Equals() method in C# returns a value indicating whether this instance is equal to a specified object or UInt32. This method provides two overloads for comparing 32-bit unsigned integers with different parameter types. Syntax Following are the two overloads of the UInt32.Equals() method − public override bool Equals (object obj); public bool Equals (uint value); Parameters obj − An object to compare with this instance (first overload). value − A 32-bit unsigned integer to compare with this instance (second overload). Return Value Both methods ...

Read More

Boolean.GetTypeCode() Method in C# with Examples

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 114 Views

The Boolean.GetTypeCode() method in C# is used to return the type code for the Boolean value type. This method returns TypeCode.Boolean, which is part of the TypeCode enumeration that represents different data types in the .NET framework. Syntax Following is the syntax for the Boolean.GetTypeCode() method − public TypeCode GetTypeCode(); Return Value This method returns TypeCode.Boolean, which represents the Boolean data type in the TypeCode enumeration. Using GetTypeCode() with Boolean Values Example using System; public class Demo { public static void Main(String[] args) { ...

Read More
Showing 491–500 of 25,467 articles
« Prev 1 48 49 50 51 52 2547 Next »
Advertisements