.net vs java.
Replies: 4   Views: 1243  Subscribers: 0

Posted by reece · 14-05-2012 - 15:15

Edited by reece · 12-11-2012 - 04:00
LOL, Java and .NET's C# are nearly identical and C#­
Similar but no where near identical. For this i needed to do a little googling to get a much clearer set of differences between the 2, initially i was going to point out things like namespaces, however i forgot java packages are actually almost the same thing. Here is what i found. Java does not for example contain unsigned integers, you would just use a regular integer. Java also does not support Partial classes, properties, operator overloading, indexers, implicit/explicit conversions, pointers, reference parameters, C# also supports lifted (nullable) types, Java does not. So if you work with a nullified numeric type in an equation in Java, you will get a NullPointerException. However in C# if you specify a type with a question mark after it then it will become lifted and a result can come of the equation. I thought i would explain this one a little because i did not know about this but found it quite interesting and thought i would share it. This is what i found from wikipedia. ­
Integer a = 42;
Integer b = null;
// This will generate a runtime NullPointerException,
// because it attempts to unbox the null value.
Integer c = a * b;­
int? a = 42;
int? b = null;
// c will receive the null value
// because * is lifted and one of the operands are null
int? c = a * b;­
The article i got a lot of this information from was ­Comparison of C# and Java­ The list i provided is by no means extensive, infact the comparison chart i drawn from is enormous and i did not wish to go through it reiterating the same points. So i picked out only the items i felt most relevant and common in programming languages. Further more if it seems like i am picking on Java i am not, its just that it would appear from the chart C# does have more features than Java but this may be simply because C# is a much newer language than Java. Java does still have some features that C# does not, but you can check them for yourself from the link. ­
C# is not limited to Windows. Think the dad would of survived if he used that rebuttal against "I want to use a programming langauge which doesn't only run on Windows". Nice video though.­[:TONGUE:]­
Hmm this is not entirely true. C# was and is primarily designed for Microsoft platforms. Support for 3rd party platforms is not provided through the official microsoft development platforms but rather through mono. Mono is a 3rd party and open source version of what Microsofts platform does. The difference being here is that Java is developed in house for all major platforms, while they do have an open source version of Java, Sun/Oracle has always supported all major platforms through their own official implementation. Also, Java works on 2 other major platforms that mono does not support (Symbian and Blackberry). This gives Java a slight edge in the mobile space in terms of interoperability and C# support on AIX is reportedly only partial.­