by Dinesh Thakur Category: Dot Net

The .NET framework provides the following tools for manag1ng user and application interfaces:

 

• Windows forms

• Web Forms

• Console Applications

• Web Services

 

These tools enable users to develop user-friendly desktop-based as well as web-based applications using a wide variety of languages on the .NET platform.

 
by Dinesh Thakur Category: Dot Net

Many people always get confused with Visual Studio .NET (VS.NET) and .NET technology. VS.NET is just an editor, provided by Microsoft to help developers to write .NET programs easily. VS.NET editor automatically generates lot of code, allow developers to drag and drop controls to a form, provide short cuts to compile and build the application etc.

 
by Dinesh Thakur Category: Dot Net

When you initialize a variable using the new operator, you are in fact asking the compiler to provide you some memory space in the heap memory. The compiler is said to "allocate" memory for your variable. When that variable is no longer needed, such as when your program closes, it (the variable) must be removed from memory and the space it was using can be made available to other variables or other programs. This is referred to as garbage collection. In the past, namely in C/C++, this was a concern for programmers because they usually had to remember to manually delete such a variable (a pointer) and free its memory.

 
by Dinesh Thakur Category: Dot Net

A component can be called by any .NET-based language regardless the original language of that component. The cross-language compatibility is possible because objects created in different .NET languages agree on a common set of types and features. These common types and features are spelled out in the Common Language Specification (CLS).

 
by Dinesh Thakur Category: Introduction to C#

Simplicity

All the Syntax of java is like C++. There is no preprocessor and much larger library. C# code does not require header files. All code is written inline.



 
by Dinesh Thakur Category: Introduction to C#

Microsoft Corporation developed a new computer programming language C# pronounced as 'C- Sharp'. C# is a simple, modem, object oriented, and type safe programming language derived from C and C++. C# is a purely object-oriented language like as Java. It has been designed to support the key features of .NET framework. Like Java, C# is a descendant language of C++ which is descendant of C language.



 
by Dinesh Thakur Category: Introduction to C#

Like C++ it contains three types of statements.

1. Simple Statements

2. Compound Statements

3. Control Statements

 
by Dinesh Thakur Category: Introduction to C#

An array is a group or collection of similar type of elements.

 

An array is a group or collection of similar values. An array contains a number of variables, which are accessed through computed indexes. The various value contained in an array are also called the elements of array. All elements of an array have to be of same type, and this type is called the element type of the array. The element of an array can be of any type including an array type.

 
by Dinesh Thakur Category: Introduction to C#

A string is an empty space, a character, a word, or a group of words.

A string is an empty space, a character, a word, or a group of words that you want the compiler to consider "as is", that is, not to pay too much attention to what the string is made of, unless you explicitly ask it to. This means that, in the strict sense, you can put in a string anything you want.

 
by Dinesh Thakur Category: Introduction to C#

C# is a type-safe language Variables· are declared as .being of a particular type; and each variable is constrained to hold only values of its declared type.

Variables can hold either value types or reference types, or they can be pointers. Here's a quick recap of the difference between value types and reference types.

 
by Dinesh Thakur Category: Introduction to C#

C# has a strong feature in which we can define more than one class with the Main method. Since Main is the entry point for the program execution, there are now more than one entry points. In fact, there should be only one entry point. Which will be resolved by specifying which Main is to be used to the compiler at the time of compilation as shown below:

 
by Dinesh Thakur Category: Introduction to C#

Let's begin in the traditional way, by looking at the code of a Hello World program.

1. using System;

2. public class HelloWorld

3. {

4. public static void Main()

5. {

6. II This is a single line comment

7. /* This is a

8. multiple

9. line comment */

10. Console.WriteLine("Hello World! ");

11. }

12. }

 
by Dinesh Thakur Category: Introduction to C#

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.

 
by Dinesh Thakur Category: Introduction to C#

The Function defined with in class is called method. It is a code designed to work on the member data of class.

 

Methods are operations associated with types. To provide a type with methods is to give it some useful functionality. Often this functionality is made generally available, so that it can be utilized by other types.

 
by Dinesh Thakur Category: Introduction to C#

An enumeration is a special set of numeric type string literals which considered as a constants.

An enumeration is a special kind of value type limited to a restricted and unchangeable set of numerical values. By default, these numerical values are integers, but they can also be longs, bytes, etc. (any numerical/value except char) as will be illustrated below.

 
by Dinesh Thakur Category: Introduction to C#

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), The following example shows a partial declaration for a 'Coordinate' struch.

 
by Dinesh Thakur Category: Introduction to C#

C# uses a series of words, called keywords, for its internal use. This means that you must avoid naming your objects using one of these keywords.

 
by Dinesh Thakur Category: Introduction to C#

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)

 
by Dinesh Thakur Category: Introduction to C#

In the body of a method, you can also declare variables that would be used internally. A variable declared in the body is referred to as a local variable. It cannot be accessed outside of the method it belongs to. After declaring a local variable, it is made available to the method and you can use it.

 
by Dinesh Thakur Category: Introduction to C#

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.

 

Page 1 of 3



About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.