In
Java it is necessary to explicitly down cast, particularly when using utilities that retrieve to Object references, for example, and code designed to benefit from
polymorphism.
However, explicit down cast and code using instanceof are often responsible bugs and perpetual maintenance problems.
Does anyone know if there is an effort to eliminate the need for explicit down cast in core Java or using an extension? Any examples, extensions, or research findings that make it forever impossible to eliminate? Any comment on family polymorphism for core Java?
By the way, some fans of Scala tell me that Scala does not have this problem (that it is never necessary to explicitly down cast in Scala). Is this so? Show me. I don't know enough about Scala but it does not look that way.
Thanks in advance.
Juan Rolando Prieur-Reza, M.S., LSSBB, SCEA, SCBCD, SCWCD, SCJP/1.6, IBM OOAD, SCSA