Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the equivalent JVM in C#?

Tags:

java

c#

The JVM is required to run a java application.

I wanted to know is there any equivalent in c#?

If yes what is it?

like image 878
GuruKulki Avatar asked Jan 11 '10 13:01

GuruKulki


People also ask

What is JVM in C language?

A Java virtual machine (JVM) is a virtual machine that enables a computer to run Java programs as well as programs written in other languages that are also compiled to Java bytecode.

Does JVM run on C?

The JVM (Java Virtual Machine) may be an interpreter or a JIT (Just In Time) compiler or both. If it is a compiler then it is writing machine code directly. It does not write C code first. The JVM might be written in C or C++ or in Java.

What is the equivalent of JVM in C#?

Of course, C# is defined purely as a language. There's no reason why it cannot be made to run on other runtimes, or indeed in an interpreted mode. But the "equivalent" of "the" JVM (implying the default one) is the CLR.

Does C have a virtual machine?

On top of that, even when you're programming in C, there is a C virtual machine! It is traditionally referred to as "the C runtime", or CRT for short.


1 Answers

The Common Language Runtime or CLR. This is the runtime that supports not just C# but also other .NET languages, such as Visual Basic.NET. Typically, each language exposes developers to a subset of the features available on the CLR (for instance, method overloading purely by return type is not generally supported in C#, but is supported by the CLR).

Just as Java compiles to bytecode, C# and other .NET languages compile to Microsoft Intermediate Language (MSIL) - the only language to expose the complete set of CLR features.

Of course, C# is defined purely as a language. There's no reason why it cannot be made to run on other runtimes, or indeed in an interpreted mode. But the "equivalent" of "the" JVM (implying the default one) is the CLR.

like image 125
David M Avatar answered Oct 05 '22 22:10

David M