Thursday, 1 December 2016

Difference in Java and .NET

The main difference is that Java is programming language while .NET is a framework which is implemented and used with various programming languages like Visual Basic, C#, Fortran and etc. So comparing java and .NET is like comparing painting and frame. You can't really compare them, because they are different objects with different purposes. But still we need to clear the misconception. So here it goes…

What are they??..

  • Java is an object-oriented programming language, developed by Sun Microsystems, which is translated into a platform-independent language called bytecode and executed by the Java virtual machine. 
  • .NET is an assortment of Microsoft proprietary items. Basically, .NET refers to Microsoft's virtual machine, the bytecode for that machine, and the set of languages which can be translated into bytecode for that machine. 

What's their development environment??..
  • For .NET a standard development IDE is available that is Microsoft Visual Studio. This tool comprises of all the things you require for your development purpose (Each and every thing you may think need of are at single place).
  • Whereas, for Java no such standard tool is available. Although, many third party IDEs are available.
Friendliness.. 
  • .NET provide more user friendliness when designing the forms for example in .NET we drag and drop controls into form which is not at all mind teasing process. Developer can concentrate on the logic or other security issues. 
  • Where as in java code for creating a simple control like button also takes a lot of programming for a developer. Therefore it’s all about coding coding and coding (It can be also drag & drop).

 Syntax wise..
  • C# has a more advanced syntax and IDE and therefore more productive than java.

Garbage collector!(One of the major concern for a developer)..

  • The .Net garbage collector does not wipe away your objects as and when it likes, but will do the garbage collection in more efficient manner than Java. Basically in Java it has been upto the programmer to clean the memory manually whereas this task is moreover automated in .Net.
  • Like .Net garbage collector runs at a certain interval and see is there is any memory occupied by any object whose parent is now finished processing (for eg. you closed an application), in this case the garbage collector automatically removes the reference of that object and free up the memory, whereas in Java you need to confirm it that all the objects are destroyed before application quits.


But what’s in .NET, not in J2EE
  • Server side control
  • Serialization to XML
  • Compilation to native code

The below image will clear it all:
fig: diff in Java and .NET




No comments:

Post a Comment