May I know what is the difference between C# and .NET? When I think of C#, right away I would say it is a .NET language, but when I search for job posts, they require candid
Here I provided you a link where explain what is C# Language and the .NET Framework Platform Architecture. Remember that C# is a general-purpose, object-oriented programming language, and it runs on the .NET Framework.
.NET Framework includes a large class library named Framework Class Library (FCL) and provides user interface, data access, database connectivity, cryptography, web application development, numeric algorithms, and network communications.
.NET Framework was developed by Microsoft that runs primarily on Microsoft Windows.
Introduction to the C# Language and the .NET Framework from Microsoft Docs
C# is a programming language, .NET is a blanket term that tends to cover both the .NET Framework (an application framework library) and the Common Language Runtime which is the runtime in which .NET assemblies are run.
Microsoft's implementation of C# is heavily integrated with the .NET Framework so it is understandable that the two concepts would be confused. However it is important to understand that they are two very different things.
Here is a class written in C#:
class Example { }
Here is a class written in C# that explicitly uses a .NET framework assembly, type, and method:
class Example
{
static void Main()
{
// Here we call into the .NET framework to
// write to the output console
System.Console.Write("hello, world");
}
}
As I mentioned before, it is very difficult to use Microsoft's implementation of C# without using the .NET framework as well. My first Example
implementation above even uses the .NET framework (implicitly, yes, but it does use it nonetheless) because Example
inherits from System.Object
.
Also, the reason I use the phrase Microsoft's implementation of C# is because there are other implementations of C# available.
C# is a language, .NET is an application framework. The .NET libraries can run on the CLR and thus any language which can run on the CLR can also use the .NET libraries.
If you are familiar with Java, this is similar... Java is a language built on top of the JVM... though any of the pre-assembled Java libraries can be used by another language built on top of the JVM.
C# is a strong Object Oriented programming language that is mostly built on the .NET framework.
C# is the airplane and .NET is the runway ;)