30 Nov What is C# ?
C# is pronounced “see sharp”. C# is an object-oriented programming language and part of the .NET family from Microsoft. C# is very similar to C++ and Java. C# is developed by Microsoft and works only on the Windows platform.
Important Features of C#
- Classes and Objects
The most common applications are:
- Windows Form Application
- Console Application
- WPF Application
- ASP.NET Web Application
- Silverlight Application
Some Important things to remember while writing code for C#
- C# is case sensitive
- All statements and expression must end with a semicolon (;)
- The program execution starts at the Main method
- Unlike Java, the program file name can be different from the class name
Namespaces are C# program elements designed to help you organize your programs. They also provide assistance in avoiding name clashes between two sets of code. Implementing Namespaces in your own code is a good habit because it is likely to save you from problems later when you want to reuse some of your code. You specify the Namespaces you want to use in the top of your code. It is easy to add more if you need them. For example, when you create a new Windows Forms application, the following default namespaces will be included.
Everything in C# is based on Classes. Classes are declared by using the keyword class followed by the class name and a set of class members surrounded by braces (curly brackets). A class normally consists of Methods, Fields and Properties. Every class has a constructor, which is called automatically any time an instance of a class is created. The purpose of constructors is to initialize class members when an instance of the class is created. Constructors do not have return values and always have the same name as the class.
Also read our article about the difference between C# and C++
You can learn C# on our Level 6 NZ Diploma in Software Development which goes on for two years and covers all programming languages.