PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Java 2 SDK 1.5.0

Dave Johnston · 05 Feb 2004, 16:08 UTC
(Seems like 1.4.0 came out only yesterday...)

I know there are a few Java programmers on here, so thought you might find this interesting. I spotted on /. that Sun have released a beta of the 1.5.0 SDK 'Tiger' - details are at http://java.sun.com/j2se/1.5.0/index.jsp

What I find quite interesting are the various things they've added (see http://java.sun.com/j2se/1.5.0/docs/rel ... tures.html) like autoboxing (e.g. saves int <-> Integer conversions), generics and code metadata (sort of automatic code generation)... It's cool to see the language evolve - those are only minor changes to the language, let alone the improved libraries...

Anyway, thought you guys might like to know.
Interestingly, after initial revolt, Java architects seems to be acknowledging wisdom of having features that C++ programmers have been enjoying for years...

One thing still missing is default arguments ...
Dave Johnston · 05 Feb 2004, 18:11 UTC
Default arguments would be fantastic... I mean, as we now have a function(int a, ...) function construct, then surely it's the next logical step?
Using Java all day, I have to say that default arguments I could live without.

One question you can raise about them is whether they should be considered as far as overloading goes. I don't know off-hand how it's treated in C++, but the question is, would this be an overloaded method in Java:

int method1(int i = 6) { }
int method1(int i = 4) { }

Or does one override the other? I personally wouldn't want it to be an overload, but others may, and it's a valid point either way.

I think I read that 1.5 now includes variable arguments, which is something else taken from C++ I believe, and it's something I actually DO like the idea of.
I don't think that would be an overloaded function in either C++ or Java, because either way it takes an int as the sole argument. If you called the method without an argument (you can, since it's got a default) or even with an argument, it wouldn't know which to choose. I don't think it'd compile. Now if the second one was "double i=4.0", that'd be a different story. I wonder if "unsigned int i=4" would overload it. Probably.