• 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
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

java keywords

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which of the following are Java keywords?
goto
malloc
extends
FALSE
according to me c is the answer.is goto also a keyword.Is there any difference between keyword and reserve word.
please explain.
 
Ranch Hand
Posts: 2166
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I've read one day in this forum that 'for the exam goto is keyword'. But not sure.
Axel
 
Ranch Hand
Posts: 195
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JLS 3.9 has the list of keywords. Goto is included, though it isn't actually used.
 
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello!
Mughal and Rasmussen argues that there are keywords (...), reserved keywords (const, goto), and reserved literals (null, true, false).
But I don't think there's any real difference between them. Another book I read said that there were reserved keywords, meaning all of the words above... So...
Have a nice day!
/Kaspar
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes!goto is reserved key word that is not currentiy in use .
from new comer at javaranch
AsifMahmood
N1.imit.
operation badar
 
Ranch Hand
Posts: 2379
MySQL Database Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

goto and extends. But not FALSE, rather false is a reserved keyword. Among them goto is not cuurently in use.


------------------
azaman
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
goto and extends are key words but there are also eight reserved words:
cast,future,generic,inner,operator,outer,rest,var
Be careful, don�t confound with key words.
hope that help
 
Ranch Hand
Posts: 3141
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jordi,
Where did you get the list of 8 reserved words? Never seen them mentioned before.
The exam tests your knowledge of the keywords list in JLS �3.9 which includes 'goto' and 'const' even though they aren't utilized in the language.
'true', 'false' and 'null' are literals, not keywords. Like the cannot be used as identifiers.
You'll see questions about keywords and about identifiers.
------------------
Jane Griscti
Sun Certified Programmer for the Java� 2 Platform
[This message has been edited by Jane Griscti (edited July 15, 2001).]
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jane!
I read this in a book "JAVA 2 Manual de usuario y tutorial" by Agust�n Froufe.
He is one of the best author about of java in Spain.
 
Jane Griscti
Ranch Hand
Posts: 3141
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well that would explain it, can't read Spanish First time I've seen those words referred to as reserved; wonder where the author got the info? There's nothing in the JLS that I could see.
------------------
Jane Griscti
Sun Certified Programmer for the Java� 2 Platform
 
Ranch Hand
Posts: 201
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I guess, Jane is right. Jordi ,there r no such keywords like these mention anywhere in JLS / in any Certification book.
This cld be confusing for the wanna-be-SCJP's .
Cross check ur ans before submitting here
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
I don�t would like confound to the people, I try help only.
This link go to the page book where I read the information about reserved words.
The author is Agust�n Froufe, recomendable for a lot of teachers of Java. http://www.cica.es/formacion/JavaTut/Cap1/progra.html
Sorry for my bad english
 
Jane Griscti
Ranch Hand
Posts: 3141
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jordi,
I didn't doubt you read the information somewhere Unfortunately, I'm fairly sure its wrong. If the listed words were truly 'reserved' you would not be able to use them as identifiers; when, in fact, you can.
The following code compiles without any errors.

Whereas, if you try to use a keyword or the literals 'true', 'false', or 'null' as identifiers you get a compile error.
Hope that helps.
------------------
Jane Griscti
Sun Certified Programmer for the Java� 2 Platform
 
mister krabs
Posts: 13974
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And the list didn't include strictfp which is reserved.
------------------
Tom - SCJP --- Co-Moderator of the Programmer Certification Forums
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic