Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #35695 > unrolled thread

Re: Forward references

Started byArne Vajhøj <arne@vajhoej.dk>
First post2016-10-02 19:59 -0400
Last post2016-10-02 19:59 -0400
Articles 1 — 1 participant

Back to article view | Back to comp.lang.java.programmer

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Forward references Arne Vajhøj <arne@vajhoej.dk> - 2016-10-02 19:59 -0400

#35695 — Re: Forward references

FromArne Vajhøj <arne@vajhoej.dk>
Date2016-10-02 19:59 -0400
SubjectRe: Forward references
Message-ID<nss71q$btl$1@gioia.aioe.org>
On 10/2/2016 11:45 AM, Stefan Ram wrote:
>   An old C compiler from the 70s is a one-pass compiler IIRC,
>   so it does not do "forward references".
>
>   I am used so much to this, that I actually was not sure
>   whether in Java the following program is correct:
>
> class A implements B {}
>
> interface B {}

>   In the first line, we use an interface that will be
>   define only later!
>
>   Turns out, Java accepts this.

I am not surprised.

javac take a sort of global approach to compilation.

And I am pretty sure that you have written code where
A refer to B and B refer to A. And it worked fine
without any special declarations.

Arne

[toc] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web