0% found this document useful (0 votes)
113 views13 pages

Introduction of C#

C# is an object-oriented programming language developed by Microsoft for building robust and reliable applications. It was designed to support .NET and web development. C# combines the best elements of C++ and Java but aims to be simpler, more modern and productive. It differs from C++ in not requiring header files and having objects by default. C# differs from Java in array and constant declaration and supporting structs and operator overloading.

Uploaded by

gauravkakkar28
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
113 views13 pages

Introduction of C#

C# is an object-oriented programming language developed by Microsoft for building robust and reliable applications. It was designed to support .NET and web development. C# combines the best elements of C++ and Java but aims to be simpler, more modern and productive. It differs from C++ in not requiring header files and having objects by default. C# differs from Java in array and constant declaration and supporting structs and operator overloading.

Uploaded by

gauravkakkar28
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 13

Introduction of C#

What is C#
• C# is new computer programming language
developed by Microsoft corporation, USA.
• C# is a fully object-oriented language like java.
• It has been designed to support the key features
of .NET Framework.
• It is a simple, efficient, productive and type safe
language derived from the popular C and C++
language suitable for developing Web based
applications.

Cont……..
Cont……

• C# is designed for building robust, reliable


and durable components to handle real-
world application.
• C# is the first “component oriented”
language in the C/C++ family
• Component concepts are first class:
– Properties, methods, events
– Integrated documentation using XML
Why C#
• Because Microsoft wanted an environment that
is completely in tune with current and emerging
web-programming practices and one that easily
integrates with existing systems.
• Therefore Microsoft decided to design a new
language starting with a clean slate.
• The result is C#, a simple and modern language
that directly addresses the needs of component-
based software development.
Evolution of C#

Object
Concept Concept
Oriented

C++
Power

Component
JAVA Oriented C# VB
Elegance Productivity
Evolution of C#
• Like java, C# is a descendant of C++ which in
turn is a descendant of C as shown in fig.
• C# borrows Java’s feature such as grouping of
classes, interfaces and implementation together
in one file so that programmers can edit the
code more easily.
• C# uses VB’s approach to form design, namely,
dragging control from a tool box, dropping them
onto forms and writing event handlers for them.
Characteristics of C#
• Simple
• Consistent
• Modern
• Object- Oriented
• Type- safe
• Versionable
• Compatible
• Inter-operability
• Flexible
How Does C# Differ from C++?
• C# Does not separate class definition from
implementation. Classes are defined and
implemented at the same place and therefore
there is no need for header files.
• The first character of the Main() method is
Capitalized. The Main must return void type value.
• C# doesn’t support #include statement.
• All the data types in C# are inherited from the
object super class and therefore they are objects.
• C# permits declaration of variables between goto
and label.
• C# doesn’t support Multilevel inheritance
How Does C# Differ From Java
• Arrays are declared differently in C#.
• Java uses static final to declare a class
constant while C# uses const.
• C# supports the struct type and java does not
• Java does not provide for operator overloading.
• C# provides the fourth type of iteration
statement, foreach for quick and easily iteration
over collections and array type data.
• C# adds internal, a new accessibility modifier.
Simple C# Program
• C# can be used to develop two categories of
programs, namely
– Executable application programs and
– Component libraries
• Executable programs are written to carry out
certain task and require the method Main in one
of the classes.
• Component libraries do not require Main method
because they are not stand alone application
programs. They are written for the use by other
applications. This concept is similar to applets
and application programs in Java.
C# Program

Executable Library
Programs Programs

Application
CLR Program

CLR
Output

Output
C# Program
• Class Sample
• {
• Public static void Main (String[] args)
• {
• System.Console.WriteLine(“C# is sharper
than C++);
• }
• }
• Compilation and Execution

Compilation

Language
Source Code Code (IL)
Compiler

JIT
Native Code
Compiler

Execution

You might also like