What are the major differences between C# and Java?

 Posted by Niladri.Biswas on 5/15/2013 | Category: C# Interview questions | Views: 2048 | Points: 40

1)C# being a .NET language, supports language interoperability.This is not possible in Java.

2) The code written in C#, on compilation generates an ‘.exe’ or ‘.dll’ file which is also called Portable Executable file. These files contain MSIL (Microsoft Intermediate Language) code. As against this, the Java code on compilation generates a ‘.class’ file, which contains bytecode.

3)The portable executable file of C# can contain any number of classes, whereas, the ‘.class’ file in Java contains only one class.

4)The methods in C# are not virtual by default. On the contrary, methods in Java are virtual by default, which degrades the performance.

5)The classes in C# are grouped in Namespaces, whereas, classes in Java are grouped in Packages.

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response