- C# is a simple, modern, object oriented language derived from C++ and Java.
- It aims to combine the high productivity of Visual Basic and the raw power of C++.
- It is a part of Microsoft Visual Studio7.0.
- Visual studio supports Vb, VC++, C++, Vbscript, Jscript. All of these languages provide access to the Microsoft .NET platform.
- .NET includes a Common Execution engine and a rich class library.
- Microsoft's JVM equiv. is Common language run time (CLR).
- CLR accommodates more than one languages such as C#, VB.NET, Jscript, ASP.NET, C++.
- Source code --->Intermediate Language code (IL) ---> (JIT Compiler) Native code.
- The classes and data types are common to all of the .NET languages.
- We may develop Console application, Windows application, and Web application using C#.
- In C# Microsoft has taken care of C++ problems such as Memory management, pointers etc.
- It supports garbage collection, automatic memory management and a lot.
MAIN FEATURES OF C#
1.SIMPLE
1. Pointers are missing in C#.
2. Unsafe operations such as direct memory manipulation are not allowed.
3. In C# there is no usage of "::" or "->" operators.
4. Since it`s on .NET, it inherits the features of automatic memory management and garbage collection.
5. Varying ranges of the primitive types like Integer, Floats etc.
6. Integer values of 0 and 1 are no longer accepted as Boolean values. Boolean values are pure true or false values in C# so no more errors of "="operator and "=="operator.
"==" is used for comparison operation and "=" is used for assignment operation.
2.MODERN
1.C# has been based according to the current trend and is very powerful and simple for building interoperable, scalable, robust applications.
2. C# includes built in support to turn any component into a web service that can be invoked over the Internet from any application running on any platform.
3.OBJECT ORIENTED
1. C# supports Data Encapsulation, inheritance, polymorphism, interfaces.
2. (int, float, double) are not objects in java but C# has introduces structures(structs) which enable the primitive types to become objects
int i=1;
String a=i Tostring(); //conversion (or) Boxing
4. TYPE SAFE
1. In C# we cannot perform unsafe casts like convert double to a Boolean.
1. Value types (primitive types) are initialized to zeros and reference types (objects and classes are initialized to null by the compiler automatically.
3. Arrays are zero base indexed and are bound checked.
4. Overflow of types can be checked.