C# (pronounced "C sharp") is a statically typed, object-oriented programming language developed by Microsoft and first released in 2000. It compiles to an intermediate language that the .NET runtime executes, and it is garbage collected.
Why it matters
C# is the main language of the .NET ecosystem, used for ASP.NET web applications and APIs, Windows software, cloud services and, through the Unity engine, a large number of games. It has evolved quickly, adding generics, LINQ queries, async/await and pattern matching, while .NET itself now runs on Windows, Linux and macOS. Teams working in Microsoft-centric environments often choose it for its tooling and strong typing.
Example
using System;
using System.Linq;
var scores = new[] { 3, 8, 5 };
var top = scores.Where(s => s > 4).Max();
Console.WriteLine(top);
Where filters the array and Max picks the largest remaining value, so the program prints 8. The var keyword infers the type at compile time.
Common mistakes
- Blocking on async code with
.Resultor.Wait(), which can cause deadlocks. - Forgetting to dispose of resources such as database connections with
using. - Confusing
nullhandling after enabling nullable reference types.
Related
Get notified when this term updates
Plus occasional practical tips on uptime and monitoring, nothing else. Unsubscribe anytime.
यह पेज सामान्य जानकारी है, जिसे हमारी संपादकीय टीम ने लिखा है और दस्तावेज़ीकरण बदलने पर अपडेट किया जाता है। सर्वर और प्रदाता अलग-अलग होते हैं, इसलिए बदलाव पहले सुरक्षित तरीके से जाँचें। देखें: संपादकीय नीति और अस्वीकरण.