2. Terminologies in C Sharp .
Structure is a user-defined value type which encapsulates member data and member function.
A struct is a user-defined value type. It is declared in a very similar way to a class, except that it can't inherit from any class, nor can any class inherit from it (as mentioned previously, however, all value types do inherit from System.object. It capsules all the variable under one roof .
b. Scope of variable
Static double Length;
Static void welcome()
console. WriteLine ("welcome to the wonderful world of c#");
Static void Main ()
console. WriteLine ();
After declaring such a variable, you can access from any method that belongs to the same class. Here is an example, to understand the concept of static variable.
Use of static variable
static double Length;
static double Width;
static double Area;
static double Get The Length ()
console. Write ("Length: ");
Len= double. Parse (console. Read Line ());
static double GetThewidth()
console. Write ("width: ");
w = double. Parse (console. Read Line ());
static void AreaRect ()
console. WriteLine ("Enter the Length and width of Rectangle ");
width = Get The width();
Length = Get The Length();
Area = Length * width;
static void show Area()
console. Write Line(" characteristics of Rectangle");
console. write Line("Length: "+ Length);
console. Write Line("width :"+ width);
Console. Write Line("Area :"+ Area); }
static void Main()
Show Area() ;
console. Write Line (); }
Enter the Length and Width of Rectangle
Characteristics of Rectangle
Area : 1245.85
When many people work in creating the same program, it could be difficult to keep track of the names of various classes. If more than one programmer creates a class with the same name in the same program, there would be conflict and the program would not work. The solution to avoid this situation is to delimit sections of code with names.
A namespace is a collection of classes. Namespaces in C# are used to organize too many classes so that it can be easy to handle the application.
Identifiers refer to the names of variables, functions arrays, classes, etc. created by programmer. They are fundamental requirement of any language. Each language has its own rules for naming these identifiers. To name the variables of your program, you must follow strict rules. In fact, everything else in your program must have a name.
Command line arguments are parameters supplied to the Main method at the time of invoking it for execution. To understand the concepts see the example given below:
Program of Command line argument to accept name from the command line and writes to the console. (Sample.cs)
public static void Main( string[ ] args)
console.write(" " +args);
console.write(" " +args[l]);
Execution for this program
C: > Sample My Home
Output of Example
Welcome to My Home
In Previous examples, we have used the Main method with no parameters. Notice that in the above example how the Main is declared.
Main is declared with a parameters args. The parameter args is an array of strings. Any arguments provided in the command line at the time of execution, are passed to the array args as its elements. We can access the array elements by using a subscript like args,args and so on.
Like as in the command line" C:> Sample My Home", args[O] and args contains:
Args  <-- My
args  <-- Home
There fore the values will be display of these parameters in Console.Write() statement.
||Terminologies in C Sharp|
||Introduction to C Sharp|
||Hello World Program|
||C vs C Sharp|
||C Sharp vs C Plus Plus|
||C SHARP vs JAVA|
||Array and Types of Array|
||Programs - Sum of all numbers in Array|
||Strings and Types of Strings|
||Delegates in C sharp|
||System Collection Generic|
||Dot Net Assembly|
||Events in C Sharp|