• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Keywords again

 
Ranch Hand
Posts: 141
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
As per the RHE book,true,false,null are keywords
But to my belief, these are literals only!
Well, strictfp is a keyword but what about switch?
Well, I feel it's a keyword too
But why then the book(See page 6 and 7) didnot mention it!
Please put some light on this and correct me if i am wrong!
regards and thanks javaranch for your kind contribution to java
society in general
nm
 
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
nm,
switch is definitely a keyword and it is very much mentioned on the last line of page 6 unless you have a older version and it is not mentioned there. In the latter case I suggest you check the errata. Also, for the latest list of keywords, please refer to the link below.
http://java.sun.com/docs/books/tutorial/java/nutsandbolts/_keywords.html
suma

 
Ranch Hand
Posts: 3143
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Keywords listed in Just Java 2 (pp.87-88)
Used for built-in type:
boolean
char
byte, short, int, long,
float, double, widefp, strictfp
void
Used in Expressions:
new, this, super
Used in statements:
selection statments : if, else, switch, case, break, default,

iteration statements : for, continue, do, while,
transfer of control statements : return, throw,

exception statements : try, catch, finally
thread statements : synchronized
Used to modify declarations (visibility, sharing etc.):
static,
abstract, final,
private, protected, public
Used for Other method or class-related purposes:
class, instanceof, throws, native, transient, volatile,
Used for larger-than-class building blocks:
extends,
interface, implements,
package, import
Reserved for possible future use:
const, goto

Hope this clears everything up!

[This message has been edited by Angela Poynton (edited June 14, 2000).]
 
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The widefp keyword implemented in Beta 4 has been removed due to public review feedback. true, false are boolean literals and
null is just ;-) a reserved word. Java identifires must not be true, false or null.
regards
Michal
 
Rancher
Posts: 241
Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One thing I recall from my studies is that no Java exam will ask you to distinguish between "keywords" and "reserved words".
Eric
[This message has been edited by Eric Barnhill (edited June 18, 2000).]
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic