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


Groups > comp.lang.java.programmer > #27415

Re: You put because it is not there

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post01.iad.highwinds-media.com!fx32.iad.POSTED!not-for-mail
From Arved Sandstrom <asandstrom2@eastlink.ca>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0
MIME-Version 1.0
Newsgroups comp.lang.java.programmer
Subject Re: You put because it is not there
References <error-message-20140127232916@ram.dialup.fu-berlin.de> <mcmurtrie-A8FF22.21325427012014@c-61-68-245-199.per.connect.net.au>
In-Reply-To <mcmurtrie-A8FF22.21325427012014@c-61-68-245-199.per.connect.net.au>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 8bit
Lines 35
Message-ID <0vNFu.291714$WT.111712@fx32.iad> (permalink)
X-Complaints-To abuse@newsgroups-download.com
NNTP-Posting-Date Tue, 28 Jan 2014 12:36:12 UTC
Organization Public Usenet Newsgroup Access
Date Tue, 28 Jan 2014 08:36:11 -0400
X-Received-Bytes 2044
X-Received-Body-CRC 2967790617
Xref csiph.com comp.lang.java.programmer:27415

Show key headers only | View raw


On 01/28/2014 01:32 AM, Kevin McMurtrie wrote:
> In article <error-message-20140127232916@ram.dialup.fu-berlin.de>,
>   ram@zedat.fu-berlin.de (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 complete source code was:
>>
>> public final class Main
>> { public static void main( final java.lang.String[] args )
>>    { if( true )int x; }}
>
> Eclipse's suggestions turned that into:
>     if (true) assert int.class != null;
>
> I didn't know primitives had a synthetic class field.  I tried it and
> found that int.class is a shortcut for Integer.TYPE.
>
[ SNIP ]

FWIW I didn't know this either. I also had to quickly fire up a quick 
test program to try it out. :-) Learn something new every day.

AHS
-- 
When a true genius appears, you can know him by this sign:
that all the dunces are in a confederacy against him.
-- Jonathan Swift

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Re: You put because it is not there Kevin McMurtrie <mcmurtrie@pixelmemory.us> - 2014-01-27 21:32 -0800
  Re: You put because it is not there Arved Sandstrom <asandstrom2@eastlink.ca> - 2014-01-28 08:36 -0400

csiph-web