J
Jesper Nordenberg
Roedy Green said:Exactly. I suggest the notion of LIKE. You can declare a temporary
variable like some other variable or method result. That way your
temporary automatically tracks. e.g. selects long instead of int, when
the master template variable is grown or shrunk.
Yes, it would be nice to get rid of the variable type declaration and
write for example:
var x = myObject.getSomething();
x.someMethod();
I think the reason why Sun is not likely to add this feature to the
Java language is that you could potentially run into trouble if you
change the return type of getSomething() to a class that have a
someMethod() with different semantics than the original someMethod().
Today you can only change the return type to a sub class of the
original class/interface, and thus the someMethod() is guaranteed to
have the same sematics.
/Jesper Nordenberg