Usage of Finally block to Close a StreamWriter
Value Types in C#
decimalintbool bytesbytechardoublefloatlongshortuintulongushort … [Continue reading]
finally block in C#
Sometimes , it might be necessary to define a block of code that needs to be executed regardless of the exception. For example , you might want to close the database connection or close the file . finally block can usually be used for this … [Continue reading]
Params in C#
The Params keyword in C# lets the developers to specify parameter for the method that can take variable no. of arguments . For example In the above sourcecode , the method Data accepts the parameter integer array . since the parameter is … [Continue reading]
Pass by Value by default
By default , the Value type (Data types) are pass by value . Below is a sample sourcecode that demonstrates the pass by value . … [Continue reading]
out keyword in c#
You can use the keyword out in c# to pass the arguments by reference . The out keyword works almost the same as ref keyword but one of the difference between the out and ref keyword is that out doesn't require the variable to be initialized where … [Continue reading]
Pass by Reference using ref keyword
You can use the keyword ref in csharp to pass a value by reference instead of call by value . using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Namespace1 { … [Continue reading]
@ Operator in C#
Although it is not the best practise , If you want use the reserve words and the variable name , you could use the @ prefixed before the variable name . Below is a sample sourcecode that demonstrates the use of @ symbol. static void Main() { … [Continue reading]
Using the Namespace Alias Qualifier in C#
One of the advantages of the Namespace is the organization of your code and structure . You could use the Namespace Alias Qualifier that allows the developers to replace the namespace names with the alias so that the ambigous definitions of the … [Continue reading]