Articles on Trending Technologies

Technical articles with clear explanations and examples

Comparison between C# and .NET Framework

Arjun Thakur
Arjun Thakur
Updated on 17-Mar-2026 687 Views

C# is a programming language, while the .NET Framework is a comprehensive software development platform created by Microsoft. Understanding the relationship between these two is fundamental for .NET developers. The .NET Framework provides the Common Language Runtime (CLR), which serves as the execution environment for .NET applications. It also includes an extensive Base Class Library (BCL) that offers pre-built functionality for common programming tasks. What is C#? C# is an object-oriented programming language that runs on the .NET Framework. It was designed specifically for the .NET platform and compiles to Intermediate Language (IL) code, which the CLR ...

Read More

Convert.ToByte(String, IFormatProvider) Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 598 Views

The Convert.ToByte(String, IFormatProvider) method in C# converts the specified string representation of a number to an equivalent 8-bit unsigned integer, using specified culture-specific formatting information. This method is particularly useful when working with string data from different cultures that may use different number formats, such as different decimal separators or thousand separators. Syntax Following is the syntax − public static byte ToByte(string value, IFormatProvider provider); Parameters value − A string that contains the number to convert. The value must be between 0 and 255. provider − An object ...

Read More

How to print a BinaryTriangle using C#?

Arjun Thakur
Arjun Thakur
Updated on 17-Mar-2026 633 Views

A binary triangle is a pattern formed using alternating 0s and 1s arranged in a triangular shape. Each row contains an increasing number of digits, and the pattern alternates between 0 and 1 for each position across all rows. How It Works The binary triangle is created using nested loops where the outer loop controls the number of rows, and the inner loop prints the alternating 0s and 1s for each row. A toggle variable switches between 0 and 1 to create the alternating pattern − Binary Triangle Pattern 1 ...

Read More

C# program to find common values from two or more Lists

George John
George John
Updated on 17-Mar-2026 527 Views

Finding common values from two or more Lists in C# is a frequent requirement in programming. The Intersect() method from LINQ provides an efficient way to identify elements that exist in multiple collections. Syntax Following is the syntax for using Intersect() method − var result = list1.Intersect(list2); For multiple lists, chain the Intersect() method − var result = list1.Intersect(list2).Intersect(list3); Using Intersect() with Two Lists The Intersect() method returns elements that appear in both lists. It automatically removes duplicates and maintains the order from the first list − Example ...

Read More

Difference between namespace in C# and packages in Java

Samual Sam
Samual Sam
Updated on 17-Mar-2026 3K+ Views

Both C# namespaces and Java packages are used to organize code and prevent naming conflicts, but they have different features and implementations. Understanding their differences helps developers work effectively in both languages. Packages in Java Packages in Java are used to prevent naming conflicts, control access, and make searching and locating classes, interfaces, enumerations, and annotations easier. Java packages also provide access control through package-private visibility. Java Package Syntax package package_name; Example // Java equivalent concept in C# using System; namespace Company.Project.Utilities { public class Calculator { ...

Read More

Char.ConvertFromUtf32(Int32) Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 489 Views

The Char.ConvertFromUtf32(Int32) method in C# converts a specified Unicode code point into a UTF-16 encoded string. This method is particularly useful when working with Unicode characters that may be represented as numeric code points and need to be converted to their corresponding string representation. Syntax Following is the syntax − public static string ConvertFromUtf32(int utf32); Parameters utf32: A 21-bit Unicode code point representing a valid Unicode character. The valid range is from 0x000000 to 0x10FFFF, excluding the surrogate pair range (0xD800 to 0xDFFF). Return Value Returns a string object consisting of ...

Read More

How to demonstrate Prefix Operator using C#?

Ankith Reddy
Ankith Reddy
Updated on 17-Mar-2026 314 Views

The prefix operator in C# is used to increment or decrement a variable's value before using it in an expression. The prefix increment operator ++ increases the value by 1, while the prefix decrement operator -- decreases the value by 1. The key characteristic is that the operation happens before the variable's value is returned or used. Syntax Following is the syntax for prefix increment and decrement operators − ++variable; // Prefix increment --variable; // Prefix decrement The operators can also be used in expressions − result = ++a; ...

Read More

How to create a Dictionary using C#?

karthikeya Boyini
karthikeya Boyini
Updated on 17-Mar-2026 289 Views

A Dictionary in C# is a collection of key-value pairs where each key is unique. The Dictionary class is part of the System.Collections.Generic namespace and provides fast lookups based on keys. Dictionaries are useful when you need to associate values with unique identifiers, such as storing employee IDs with names or product codes with prices. Syntax Following is the syntax for creating a Dictionary − Dictionary dictionaryName = new Dictionary(); Following is the syntax for adding items to a Dictionary − dictionaryName.Add(key, value); dictionaryName[key] = value; // Alternative syntax ...

Read More

How to print a diamond using nested loop using C#?

Samual Sam
Samual Sam
Updated on 17-Mar-2026 463 Views

A diamond pattern is a common programming exercise that demonstrates the use of nested loops in C#. The diamond shape consists of two parts: an upper triangle that expands and a lower triangle that contracts. To create a diamond pattern, you need to consider three key elements − Number of rows (determines diamond size) Characters to display (commonly $ or *) Leading spaces for alignment Diamond Pattern Structure Upper Triangle Row 1: 4 spaces + 1 char Row 2: 3 spaces + ...

Read More

C# Linq Distinct() Method

George John
George John
Updated on 17-Mar-2026 908 Views

The Distinct() method in C# LINQ is used to remove duplicate elements from a collection and return only unique elements. This method is available for any collection that implements IEnumerable and preserves the order of first occurrence. Syntax Following is the basic syntax for the Distinct() method − IEnumerable Distinct() IEnumerable Distinct(IEqualityComparer comparer) Parameters comparer (optional) − An IEqualityComparer to compare elements for equality. If not provided, the default equality comparer is used. Return Value Returns an IEnumerable containing distinct elements from the source sequence. Using ...

Read More
Showing 11361–11370 of 61,303 articles
Advertisements