C# is an Object-oriented programming language. It is similar to C++ and Java.
It is developed by Microsoft corporation and Everything is class.
C# Features
- Multi-threaded
- Strongly Typed
- Modern designed strong concepts
- Object Oriented Programming
It supports the following features
- Class & Objects
- Encapsulation using setter and getter
- Inheritance using Interface and Abstract
- Polymorphism using overload and overriding
- Type Safe and automatic Garbage Collection
C# language uses the .NET framework to develop and run the code .NET framework is an infrastructure designed by Microsoft for developing, running, and deploying applications. It Contains Language Runtime, Framework classes, and ASP.net.
C# Language built and inspired from other programming languages
-Performance from C Language
- Object Oritend Concepts from C++
- Security from Java
- Fast Application Development from Visual Basic
Naming conventions in C
Microsoft recommends following naming conventions in program code features
PascalCase means identifier words that contain Capitalize the first character of every word. For example, EmployeeObject. camelCase means capitalize the first character of each word except the first word
|Parameter | Description | Example
|:——–| ————— |
|namespace| PascalCase| namespace EmployeeModule{}
|Class| Pascal Case| class Employee{}
|Type| Pascal Case| type Employee{}
|Interface| Pascal Case| interface User{}
|Method| Pascal Case| ```csharp public class Employee {public virtual int GetSalary();}`|
|Method| Pascal Case| csharp public int salary { set,get; }`| |Field| Pascal Case|
csharp public const Age = 25;| |Event| Pascal Case| ```csharp public event EventHandler OnClick;
|
|Enum Class and Value| Pascal Case| csharp public class WeekEnd{Sunday,Saturday} `| |Argument| Camel Case|
csharp public static int SetSalary(int value);`|
- Code Written is a case-sensitive
C# Code process in two steps
- Compile time, Takes C# code and output Byte code
- Runtime: Input Byte code, output Native code