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


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

Re: You put because it is not there

Started byEric Sosman <esosman@comcast-dot-net.invalid>
First post2014-01-27 18:13 -0500
Last post2014-01-27 18:13 -0500
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: You put because it is not there Eric Sosman <esosman@comcast-dot-net.invalid> - 2014-01-27 18:13 -0500

#27412 — Re: You put because it is not there

FromEric Sosman <esosman@comcast-dot-net.invalid>
Date2014-01-27 18:13 -0500
SubjectRe: You put because it is not there
Message-ID<lc6p79$c4q$1@dont-email.me>
On 1/27/2014 5:49 PM, Stefan Ram wrote:
>    Sometimes, it is surprising what error messages Java
>    implementations give:
>
> Main.java:3: error: '.class' expected
>            { if( true )int x; }}
>                            ^
>    Does the implementation really expects to see
>    »if( true )int .class« or »if( true ).class«?

     The former.  That's what it said; why should you
disbelieve what it says about its own expectations?  ;-)

     Was its expectation reasonable?  I think so, because
given the prefix `if ( true ) int' I can imagine no other
continuation than `. class' that could be part of a valid
parse, as in `if (true) int.class.getClassLoader();'.

     Can you think of any other valid continuations?

-- 
Eric Sosman
esosman@comcast-dot-net.invalid

[toc] | [standalone]


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


csiph-web