This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Error: Non-static method overrides static method


On Monday 28 June 2004 20:25, Tom Tromey wrote:

> Furthermore, it is a little-known corner of the Java language that
> you can write:
>
>     expr.method ();
>
> ... where `method' is a static method.  This evaluates `expr' for side
> effects and then calls the static method.  Goofy, perhaps useless, but
> there it is.

Sometimes I'm glad I only have to deal with bytecode. :0 Out of curiosity, 
what means "evaluates `expr' for side effects"? Is
    instanceOfFoo.instanceMethod().staticMethod()
somehow different to 
  instanceOfFoo.instanceMethod(); Foo.staticMethod();
or is there some other magic involved?

-- 
Chris Gray                      /k/ Embedded Java Solutions
Embedded & Mobile Java, OSGi        http://www.kiffer.be/k/
chris.gray@kiffer.be                         +32 3 216 0369


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]