C# Enumeration

Posted in C#Tagged ,

Enumeration use for to assign multiple constant integral values to a single variable. Enumeration improves code clarity and makes program easier to maintain easy way. Enumeration in C# also provides more security by better error-checking technology and compiler warnings. An enumeration can be defined using enum keyword. In enumeration, you can define special set of….

C# Using Statement

Posted in C#Tagged ,

In this article i am explaining about using statement in c#.The using statement is usually used once you ought to one or a lot of resources during a section. The victimisation statement obtains one or numerous resources, executes them so releases the objects or resources. it’s wide used in information property through C#. Example: using….

C# Lock Statement

Posted in C#Tagged , ,

In this article i am explaining about lock statement in c#. The lock statement handle lock segment as a critical section and lock the object during the execution of program from other thread. Once the execution is completed it releases the lock and frees objects. Example: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace….

C# Unchecked Statement

In this article i am explaining about Unchecked key word. The unchecked statement ignores the stack overflow exception and executes the program so, the output can be incorrect. Example: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Unchecked_Statement {     class Program     {         static void Main(string[] args)         {             int n;             // assign maximum value             n = int.MaxValue;….

C# Checked Statement

In this article about checked statement. The checked statements force fully C# to raise exception whenever underflow or stack overflow exception occurs due to integral type arithmetic or conversion issues. Example: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace CheckedStatementExample {     class Program     {         static void Main(string[] args)         {             int n;             // assign maximum….

C# Throw Statement

Posted in C#Tagged , ,

In this article i am explaining about Throw Exception. Throw statement is used for throwing exception in a program. The throwing exception is handled by catch block. Example: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Throw_Statement_Example { class Program { static void Main(string[] args) { int n1, n2, result; Console.WriteLine(“Enter First Number”); n1….

C# Return Statement

A return statement is used for returning value to the caller from the called function. A very  easy example is mentioned below in a program that demonstrate the return statement very clearly and easy. Example: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Return_Statements {     class Program     {         public int Add(int n1, int n2)….

C# Continue Statements

The continue statements enables you to skip the loop and jump the loop to next iteration. Example: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Continue_Statements_Example { class Program { static void Main(string[] args) { int i = 0; while (i < 10) { i++; if (i < 6) { continue; } Console.WriteLine(i); }….

C# Break Statement

The break statement is used to terminating the running statement of program and transfer controls to the next execution. Example: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Break_Statements_Example {     class Program     {         static void Main(string[] args)         {             int i = 0;             while (i < 100)             {                 Console.WriteLine(i);                 if (i == 20)                 {                     Console.WriteLine(“Breaking the….

C# Goto Statement

Posted in C#Tagged ,

The goto statement is a jump statement that controls the execution of the program to a different section of an equivalent program. You produce label at anywhere in program then will pass the execution management via the goto statements. Example: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace GoTo_Statements_Example { class Program { static….