Note: I have no read the complete discussion, so please apologize if I will reapeat something previously mentioned.
Hm, I’m perferctly happy with the new features, which become avaible in the tiger release. This may be because I’ve worked with C# 2.0 since the .NET Framework 2 Beta was availbale and don’t want wot miss anything now in programming in Java.
At first I like the new enumeration type. Although IMHO it wasn’t really needed, it is saves a little bit code using the BitVector class and it offers great flexibility compared to other languages.
Auto-boxing is the ony feature I’m watching with a good and a bad eye. The implementation shouldn’t be compared to the one of C# since the C# compiler only performs (forward) auto-boxing. In contrast to that the Java version can do auto-unboxing (back from the reference type to a value type).
Although in most cases the amount of code reduces, there are some issues I don’t like because the lack of constancy, e.g.
Integer i1 = 100, i2 = 100; // same as Integer.valueOf(100), i2 = Integer.valueOf(100);
Integer j1 = 100, j2 = 200; // same as Integer.valueOf(200), j2 = Integer.valueOf(200);
System.out.println(i1==i2); // true
System.out.println(j1==j2); //false
Of course the comparison is done on the reference and not the values, but i0,i1 share the same object while j1 and j2 don’t. That is because the wrapper classes only have a cache for often used numbers between [-128 /or 0.0,127].
As it comes for generics, I won’t take my hands on Java without them. I’m very happy with the implementation, especially that value types cannot be used with them. In C# it is o.k., because you can define own value types. However In Java, you cannot due to generality of reference objects, which I really prefer. (A simple language can be used and optimized more easily).
The reason I don’t want to miss generics is not because it reduces potentially number of ClassCastExceptions thrown, I love them because they enable Meta-Programming. See the algebra packe in the code I have uploaded (for Jeff) in another thread, although the code isn’t a fast as other, the matrix and vector functionality has to be programmed ones for all types, for which a field is defined. (In this sample case implemented fields are float, double and BigDecimal).
Go Java Go