Stopwatch class provides a set of methods and properties that you can use to accurately measure elapsed time. The following example demonstrates how to useRead More
Tag: .NET
In this tutorial, you will learn how to use C# preprocessor directives. The preprocessor directives give instruction to the compiler to preprocess the information beforeRead More
There are three types comments in C#: Single line comment with // …; Multiple line comments with /* … */; XML Document comments with ///Read More
The parameter of the Main method is a String array that represents the command-line arguments. Run the console application with following command: you will getRead More
The Main method is the entry point of a C# application. When the application is started, the Main method is the first method that isRead More
C# namespaces provide a way to organize related classes and other types. A namespace is a logical grouping which means the class with the sameRead More
The return statement is used to exit a method of a class, returning control to the caller of the method. If the return statement isRead More
You must use continue within a for, foreach, while, or do…while loop.It exits only from the current iteration of the loop, and start the nextRead More
The break statement terminates the closest enclosing loop or switch statement in which it appears. If it is used in the nested inner loop, it will jump out theRead More
The notorious goto statement, enables you to jump to a labeled statement. You will get compile warning that: Ignore the warning and run the program,Read More
The foreach loop enables you to iterate through each item in a collection. A collection type could be the type that implements the System.Collections.IEnumerable orRead More
The do-while statement executes a statement or a block of statements while a specified Boolean expression evaluates to true. Because that expression is evaluated afterRead More
The while statement executes a statement or a block of statements while a specified Boolean expression evaluates to true, a while loop executes zero or more times. Output: For forRead More
The for statement executes a statement or a block of statements while a specified Boolean expression evaluates to true. Output:
In this tutorial, you will learn the key point of C# switch expression for writing more cleaner code. Beginning with C# 8.0, you can useRead More
C# has two statements for branching code: the if statement and the switch statement. In this tutorial, you will learn the key points of theRead More
An if statement identifies which statement to run based on the value of a Boolean expression. Code Example if if … else if … else if …Read More
In this short tutorial, you will learn the key points of string and String type in C#. Concept C# recognizes the string keyword, which underRead More
In this short tutorial, you will learn C# digit separtor. C# 7 comes with a new feature called digit separators “_”, it is able toRead More
In this short tutorial, you will learn C# value types and reference types. Concept A value type stores its value directly, whereas a reference typeRead More