Server Side Programming Articles

Page 785 of 2109

Mutation Test tools in C#

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

Mutation testing is a software testing technique that evaluates the quality of your test suite by introducing small code changes (mutations) and checking if your tests can detect these changes. In C#, several tools are available to perform mutation testing effectively. What is Mutation Testing? Mutation testing works by creating mutants − modified versions of your source code with small, intentional bugs. A good test suite should detect these mutations and fail when run against the mutated code. The mutation score represents the percentage of mutants killed (detected) by your tests. Mutation Testing ...

Read More

Naming Conventions in C#

Ankith Reddy
Ankith Reddy
Updated on 17-Mar-2026 2K+ Views

Naming conventions in C# help maintain code readability and consistency across projects. Following standardized naming patterns makes your code more professional and easier to understand for other developers. Class Naming Conventions A class definition starts with the class keyword followed by the class name, enclosed by curly braces. The following conventions apply to class names. Pascal Casing Class names should use PascalCasing, where the first letter of each word is capitalized − public class EmployeeDetails { } public class BankAccount { } public class CustomerOrderHistory { } Noun or Noun Phrases ...

Read More

Numbers in C#

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

Numbers in C# are represented by various data types, with int being the most commonly used for whole numbers. The int type represents a 32-bit signed integer that can store values from -2, 147, 483, 648 to 2, 147, 483, 647. Basic Integer Operations C# supports standard mathematical operations on integers using arithmetic operators. Here's how to perform basic addition − using System; class Program { static void Main() { int x = 20; int y = 30; ...

Read More

Overriding in C#

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

Method overriding in C# enables runtime polymorphism by allowing a derived class to provide a specific implementation of a method that is already defined in its base class. This is achieved using the virtual keyword in the base class and the override keyword in the derived class. Overriding is essential for implementing dynamic polymorphism, where the method to be called is determined at runtime based on the actual object type rather than the reference type. Syntax Following is the syntax for method overriding using virtual and override keywords − // Base class with virtual method ...

Read More

Private Methods in C#

Chandu yadav
Chandu yadav
Updated on 17-Mar-2026 8K+ Views

Private methods in C# can only be accessed within the class where they are defined. They use the private access modifier to restrict visibility and are commonly used for internal helper functionality that should not be exposed to external code. The private access specifier allows a class to hide its member variables and member functions from other functions and objects. Only methods within the same class can access private members, providing encapsulation and data hiding. Syntax Following is the syntax for declaring a private method − private returnType MethodName(parameters) { // method ...

Read More

How to reverse a String using C#?

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

In C# there are multiple ways to reverse a string. The most common approach is using the Array.Reverse() method, but you can also use other techniques like loops or LINQ methods for different scenarios. Using Array.Reverse() Method The Array.Reverse() method is the most efficient way to reverse a string. First, convert the string to a character array, then apply the reverse method − using System; class Program { static void Main(string[] args) { string str = "Amit"; ...

Read More

How to swap two numbers without using a temp variable in C#

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

Swapping two numbers without using a temporary variable can be achieved using different techniques in C#. These methods eliminate the need for extra memory allocation and demonstrate clever mathematical and bitwise operations. Using Arithmetic Operations The most common approach uses addition and subtraction operations to swap values − val1 = val1 + val2; val2 = val1 - val2; val1 = val1 - val2; Example using System; class Program { static void Main(string[] args) { int val1, val2; ...

Read More

Networking in C#

George John
George John
Updated on 17-Mar-2026 3K+ Views

The .NET Framework provides a layered, extensible, and managed implementation of networking services that you can easily integrate into your applications. The System.Net namespace contains classes for network communication, web requests, DNS operations, and secure connections. Syntax To use networking classes, include the System.Net namespace − using System.Net; Creating a URI and web request − Uri uri = new Uri("http://www.example.com/"); WebRequest request = WebRequest.Create(uri); Using Uri Class The Uri class in C# provides object representation of a uniform resource identifier (URI). It helps parse and manipulate web addresses − ...

Read More

try keyword in C#

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

The try keyword in C# is used to define a block of code that might throw an exception. It must be followed by one or more catch blocks to handle exceptions, and optionally a finally block for cleanup code that runs regardless of whether an exception occurs. Syntax Following is the basic syntax for a try-catch block − try { // code that might throw an exception } catch (ExceptionType e) { // exception handling code } Following is the syntax with a finally block − ...

Read More

Timer in C#

karthikeya Boyini
karthikeya Boyini
Updated on 17-Mar-2026 3K+ Views

The System.Timers.Timer class in C# generates events at specified intervals. It is useful for executing code periodically, such as updating displays, checking status, or performing background tasks. The timer can be configured to fire once or repeatedly, and provides precise control over timing intervals and event handling. Syntax Following is the syntax for creating and configuring a timer − Timer timer = new System.Timers.Timer(intervalInMilliseconds); timer.Elapsed += EventHandlerMethod; timer.Enabled = true; Following is the syntax for the event handler method − private static void EventHandlerMethod(Object source, ElapsedEventArgs e) { ...

Read More
Showing 7841–7850 of 21,090 articles
« Prev 1 783 784 785 786 787 2109 Next »
Advertisements