On Jul 4, 2005, at 3:42 PM, Wilhelm Fitzpatrick wrote:
Glen, Todd... one source of confusing here is that what Todd is
trying to do (return a type that is more narrow than is defined in
the superclass/interface) *is not* allowed in Java up through
version 1.4.x, but *is* allowed in Java 1.5.
The technical term for this is "covariant return types" and they
were added to the language in 1.5.
In Java 1.4.x or earlier, the return types must match exactly, and
you just have to cast what you get back if you are in a
circumstance where you know it to be more specific.
That explains a lot. I was willing to believe that it was not
allowed, but I couldn't think why it wouldn't be allowed. I guess the
powers that be decided there was no good reason for it not to be
disallowed.
Of course, now I have to decide if I want to deal with 1.5...
Thanks everyone!!!
Todd
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden