This tutorial will introduce you to .NET framework using C# language. You will also learn to create a C Sharp based web application using .NET framework. This is a complete online course and covers topics like Introduction,first example, objects and classes,Variable and Data Types.
C# is an object-oriented programming language provided by Microsoft that runs on .Net Framework. And it was developed by Anders Hejlsberg and his team during the development of .Net Framework.
It can be used to create console applications, Windows applications, Mobile applications, etc.
It has evolved much since their first release in the year 2002.
First, its fully OOP because everything are objects. C# does not differentiate between primitive types and object types like in Java. Hence, int is an object, not a primitive type. Second, its not purely OOP because it has features that rightly belong to procedural languages such as function pointers.
A C# program consists of the following parts -
Namespaces : They are logical grouping of code (classes/interfaces) that can help in Deployment and package loading (Class loading).
Classes : It can be introduced as a collection of functions and generally contain multiple methods. Methods define the behavior of the class.
static : It is a keyword which means object is not required to access static members. So it saves memory.
void : It is the return type of the method. It doest return any value. In such case, return statement is not required.
Main : It is the method name. It is the entry point for any C# program. Whenever we run the C# program, Main() method is invoked first before any other method. It represents start up of the program.
In order to see the output of the above C# program, we have to compile it and run it by pressing Ctrl + F5, or clicking Run button or by clicking the "Debug" menu and clicking "Start Without Debugging".