Differences Between the CLR and JVM
This is a quick reference to differences between the CLR and JVM. It also bleeds into differences between C# and Java whose features often include compiler-level-only features that the underlying VirtualMachine is not cognizant of.
CLR has…
- CLR has unsigned types
- CLR has namespaces
- CLR has explicit interface implementations
- CLR allows non-overridding methods when the same signature (called 'new')
- CLR has value types
- CLR has non-virtual methods (I don't think JVM does)
- CLR has events
- CLR has out and ref parameters
- C# has partial classes
- C# has closures
- C# has yield
- C# can have multiple classes in a single file
JVM has …
- JVM has no generic types. This is purely at the compiler level. I've read that you cannot overload a method by a generic type such as List<of int> vs. List<of String>.
- Java has exception specification on the method level.
- Java has non-static inner classes
Other Differences
- assemblies vs. jars
References
- http://stackoverflow.com/questions/95163/differences-between-msil-and-java-bytecode
- http://stackoverflow.com/questions/682608/implementing-c-sharp-for-the-jvm
- http://stackoverflow.com/questions/59175/whats-the-difference-between-the-inner-workings-of-javas-jvm-and-nets-clr
- http://www.artima.com/intv/anders.html