logo       

Re: issue with inherited static members in java interfaces (possible bug?): msg#00042

lang.scala

Subject: Re: issue with inherited static members in java interfaces (possible bug?)

On Fri, 2006-02-10 at 21:36 +0100, Adriaan Moors wrote:

> According to http://www.artima.com/designtechniques/static.html,
> static members aren't dynamically bound (they are implicitly final),
> so, although they are inherited, they can't be overridden -- only
> hidden... this makes them quite useless (for anything else than simple
> utility methods)

Whatever the case, they are there and we have to live with that. I think
static members should always be accessed via the class where they are
defined and in this regard I consider Java an aberration. Luckily, Scala
agrees with me :)

I thought the issue was already discussed on the mailing list but maybe
I'm wrong because I couldn't find it with gmane. To avoid future
confusion, I went to the Scala Wiki page and added some information on
how the Scala compiler treats static members from Java classes (and I
stole the Java example from Jason's mail):

http://scala.sygneca.com/faqs/interoperability

Kudos to Jamie Webb for organizing the Wiki

Nikolay





<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise