Difference between java and .net

1 view
Skip to first unread message

Bose

unread,
Oct 15, 2010, 1:23:19 AM10/15/10
to SIG-JAVA
what is the basic difference between java and .net...why java is
better....? why people opt for learning .net than java....????

akansh bhatnagar

unread,
Oct 15, 2010, 3:54:43 AM10/15/10
to sig-...@googlegroups.com

Differences between .Net and Java include
  • Java is from Sun, .Net is from Microsoft
  • Java is a language plus a runtime, .Net is a runtime framework that supports multiple languages, Visual Basic and C# (the .Net language most similar to Java) among them.
  • C# is very similar to Java but a few years younger, and a bit nicer in some respects - it has a slightly simpler syntax for some common constructs.
  • Java is more platform independent, it runs on several operating systems including Windows, Mac and Linux. .Net is primarily for Windows. Although the open source project Mono is developing a multi-platform runtime for .Net, so this is less of an issue than it used to be. 
  • .Net has a more integrated development environment, as the IDE, runtime and server all come from Microsoft as a standard package, while Java is based on third-party tool and server providers. It used to be the case that the .Net development environment was clearly superior, but the difference is smaller these days. 
  • It can be argued that Java gives more flexibility, as there are more server- and IDE-providers to choose from, at the cost of some extra overhead for the developer to get the different pieces to work together.



http://www.cssforum.com.pk/off-topic-section/computers-technology/5270-difference-between-java-net.html
--


Best Regard,
Akansh Bhatnagar
"Great Mind think different...
...thinks Innovative thinks great"

jayati dwivedi

unread,
Oct 15, 2010, 8:26:08 AM10/15/10
to sig-...@googlegroups.com
one important difference between Java and .Net is Java is more SECURE over .Net and dats because of following reasons-
 
java needs a JVM for it's source code to be executed,which is independent of the system n works on any platform... 
so,java codes cannot b executed elsewhere but only with JVM which provides no clue ab the code.

1. auto garbage collector
developer does not have to worries about a memory leak (most of the time - for dangling reference, etc). Java does the releasing of unreferenced object for you 

2. hide pointer
Java hide pointer from developer. Allowing direct access to memory can be dangerus. Hacker can takes advantages of this to try to overwrite memory outside of application..or you accident overwrite the wrong address in your pointer arithmetic. 

3. try-catch
java provides try - catch - finally that is different from C++ try-catch. 
Java guareentee that when the an Exception occurs, the thread will goto the end of the method before unwinding the stack to where the call was..and keep doing this till the exception is handled. This is important when working with thread. When the thread exit the method..and if the thread have the object lock..then it release the lock upon exiting the method. Java try-catch-finally guareentee the release of the lock (because Java exit the method). 

4. Java is a String type language
you have two type in Java 
primitive type and object type. 
At runtime, Java knows the type of object, so Java knows what operating allows on th etype...this eliminate bad casting (for the most part) 

you can still cast wrongly: 

Person p = new Person(); 
Object o = p; 
Cat c = (Cat) o; 

compile fine, but will catch runtime exception..because Java knows the type at runtime..so trying to cast to a Cat for the Person object will generate an Exception...

5. Applet provides better security
Applet by default does not gives the Applet application permission to read or write on your computer. ActiveX (from Miscrosoft) default to allow these access. 
This encapsulte the applet..and prevent malacious code. 

as stated before..you can still write code that is not so "secure," it's just harder to do so, than any other language..Java try to protect developers from making these mistakes..and try to protect the end-user from malacious code. 

These are few reasons for why java is more secure than .net or any other language there are many more that confirms the same..
Reply all
Reply to author
Forward
0 new messages