- 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 Studio 7.0.
- Visual Studio supports VB, VC++, C++, VBscript, JScript. All of these languages provide access to the Microsft .NET platform.
- .NET includes a Common Execution engine and a rich class library.
- Microsofts JVM eqiv is Common language run time(CLR).
- CLR accommadates 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#
- Pointers are missing in C#.
- Unsafe operations such as direct memory manipulation are not allowed.
- In C# there is no usage of “::” or “->” operators.
- Since it’s on .NET, it inherits the features of automatic memory management and garbage collection.
- Varying ranges of the primitive types like Integer,Floats etc.
- 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. More On CSharp
- C# has been based according to the current trend and is very powerful and simple for building interoperable, scable, robust applications.
- 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
- C# supports Data Encapsulation, inheritance,polymorphism, interfaces.
- (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
- In C# we cannot perform unsafe casts like convert double to a boolean.
- Value types (priitive types) are initialized to zeros and reference types (objects and classes) are initialized to null by the compiler automatically.
- arrays are zero base indexed and are bound checked.
- Overflow of types can be checked.
- C# includes native support for the COM and windows based applications.
- Allowing restriced use of native pointers.
- Users no longer have to explicityly implement the unknown and other COM interfacers, those features are built in.
- C# allows the users to use pointers as unsafe code blocks to manipulate your old code.
- Components from VB NET and other managed code languages and directlyt be used in C#.
6. SCALABLE AND UPDATEABLE
- .NET has introduced assemblies which are self describing by means of their manifest. manifest establishes the assembly identity, version, culture and digital signature etc. Assemblies need not to be register anywhere.
- To scale our application we delete the old files and updating them with new ones. No registering of dynamic linking library.
- Updating software components is an error prone task. Revisions made to the code. can effect the existing program C# support versioning in the language. Native support for interfaces and method overriding enable complex frame works to be developed and evolved over time.
C# is a modern, type safe programming language, object oriented language that enables programmers to quickly and easily build solutions for the Microsoft .NET platform. Read – L298