Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #27096
| From | markspace <markspace@nospam.nospam> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: literals and keywords |
| Date | 2013-12-28 08:59 -0800 |
| Organization | A noiseless patient Spider |
| Message-ID | <l9n026$7to$1@dont-email.me> (permalink) |
| References | <keywords-20131228171259@ram.dialup.fu-berlin.de> |
On 12/28/2013 8:15 AM, Stefan Ram wrote: > Does it matter? > > Can you find any program, where one can observe the difference? > E.g., some program that does compile because they are not keywords, > but would not compile when they were keywords, or vice versa? > Or are there any other observable consequences of this difference? > Yes, it matters, or they wouldn't make a distinction. We talked about this already: literals can be used in expressions, keywords can't. The observable difference is in the implementation of the JLS. <http://docs.oracle.com/javase/specs/jls/se7/html/jls-15.html#jls-15.8> You can write "int i = 1 + 2;" but you can't write "Object o = for + try;" because that section of the JLS says so. Read it.
Back to comp.lang.java.programmer | Previous | Next — Next in thread | Find similar | Unroll thread
Re: literals and keywords markspace <markspace@nospam.nospam> - 2013-12-28 08:59 -0800
Re: literals and keywords "Chris Uppal" <chris.uppal@metagnostic.REMOVE-THIS.org> - 2013-12-28 17:28 +0000
Re: literals and keywords markspace <markspace@nospam.nospam> - 2013-12-28 10:56 -0800
Re: literals and keywords Arne Vajhøj <arne@vajhoej.dk> - 2013-12-28 14:53 -0500
Re: literals and keywords markspace <markspace@nospam.nospam> - 2013-12-28 12:41 -0800
Re: literals and keywords Arne Vajhøj <arne@vajhoej.dk> - 2013-12-28 16:36 -0500
csiph-web