Monday, October 18, 2004

Java 1.5 vs C#

J2SE 5.0 specs are out. And you know what Java 1.5 has tried to catch up with C#.
Java 2 Platform Standard Edition (J2SE) 5.0 ("Tiger") is the next major revision to the Java platform and language; it is currently slated to contain 15 component JSRs with nearly 100 other significant updates developed through the Java Community Process (JCP).

According to this slash dot post, following is a summarized list of enhancements:

1- Generics (C# 2.0 already supports this)
2- Enhanced For-Loop (the foreach construct in C# 1.0, duh!)
3- Autoboxing/Unboxing (C# 1.0 already has this, everything is an object, even the primitives - not really, but they do it so well...)
4- Typesafe Enums (again C# 1.0 already implemented this, but I think they've added a little bit more twist in Java, that its actually a better implementation)
5- Varargs (C# 1.0's params construct, ellipsis construct in C++)
Static Import (I don't know if C# 1.0 has this, or C#2.0, but C# has a construct for aliasing your imports - which is way cooler. Static Import, actually promotes bad coding habits IMHO)
6- Metadata/Annotations (this is C# 1.0's Attributes, Sun's upturned noses just gave it a fancier name - also, C#'s implementation is better and more intuitive)

1 comment:

Abubakar said...

I think you forgot to mention operator overloading.