Udemy logo

c sharp tutorial 2What is C #?

C# is a programming language developed by Microsoft. It is a fully object-oriented programming language like Java, and it’s the only component presented by -oriented language. C# is derived from C and C++ languages.  It is suitable for developing web-based applications and supports the .NET framework, Microsoft’s development platform.

Want to learn C#? Take a course at Udemy.com.

C# Features

Though C# is the successor of languages like C and C++ with several similarities in comparison, it contains several unique features:

What is .NET Framework?

Any language can access the .NET framework as well as communicate with each other using .NET libraries. In addition, it is a component-based model in which a program is broken into numerous individual components where each one offers a particular service. This mechanism is called Microsoft Intermediate Language (MSIL). The most striking feature of .NET framework is the compiler inter-operability by compiling code into an IL that is compatible with other IL modules. Microsoft .NET software provides building, deploying and running web services and other console applications. It consists of three different technologies:

Common Language Runtime (CLR) provides runtime environments for languages including C#.

The CLR provides a number of services that include:

Hello World with C#

A simple C# program has following parts:

Learn how to work with the C# language at Udemy.com.


using System;



class Hello


static void Main()


/* it is Hello World in C# */

Console.WriteLine(“Hello World”);






Hello World

Points to Note:

Compiling and Running The C# Program:

From Visual Studio

From Command line:

Example of Command Line Arguments

using System;



class Hello


static void Main(string[] args)


/* it is Hello World in using Command Line Argument */


Console.Write(“Welcome to  Command Line “);


Console.WriteLine(” “+args[1]);





Notice in this Main method declaration

public static void main(string args[])

Main method is enclosed with the parameter “args”. The parameter is the array of strings also known as “String objects“. Any arguments given in the command line at the time of execution is passed to “args” as its elements. These elements are then accessed by using subscript args[0], args[1] and so on.

If you provide three arguments at the time of execution for instance





The only difference between WriteLine() and Write() method is that the latter does not create a line break and therefore the next output will be printed on the same line.

Applications of C#


Framework Base Classes


.NET supplies a library of base classes that help you implement web applications quickly. You can use them by instantiating the program and invoking their methods. The namespace named System includes a lot of functionality.


User and Program Interfaces


.NET provides many tools for managing user applications


Tools Required for C#

One thing to note is that .NET framework only works for Windows environment and you cannot run the C# program without .NET framework. Though Mono an open source platform of .NET framework includes C# compiler, it has been developed so that it can run C# program on cross platforms, including Mac OS.

Get to know more about the C# language at Udemy.com.

Page Last Updated: May 2014

Top courses in C#

Complete C# Unity Game Developer 3D
Ben Tristem, Rick Davidson, GameDev.tv Team, Gary Pettie
4.7 (37,747)
C#/.NET - 50 Essential Interview Questions (Junior Level)
Krystyna Ślusarczyk
4.9 (301)
Highest Rated
Design Patterns in C# Made Simple
Zoran Horvat
4.4 (304)
C#/.NET - 50 Essential Interview Questions (Mid Level)
Krystyna Ślusarczyk
4.8 (131)
C# Intermediate: Classes, Interfaces and OOP
Mosh Hamedani
4.5 (31,544)
Learn Parallel Programming with C# and .NET
Dmitri Nesteruk
4.5 (3,171)
Advanced Topics in C#
Dmitri Nesteruk
4.6 (350)
RPG Core Combat Creator: Learn Intermediate Unity C# Coding
Ben Tristem, Rick Davidson, GameDev.tv Team
4.7 (10,389)
Design Patterns in C# and .NET
Dmitri Nesteruk
4.5 (10,263)

More C# Courses

C# students also learn

Empower your team. Lead the industry.

Get a subscription to a library of online courses and digital learning tools for your organization with Udemy Business.

Request a demo