Isaias
While true and false might appear to be keywords, they are technically Boolean literals (�3.10.3). Similarly, while null might appear to be a keyword, it is technically the null literal (�3.10.7).
help you means help me
Rob
SCJP 1.4
abstract default if private this
boolean do implements protected throw
break double import public throws
byte else instanceof return transient
case extends int short try
catch final interface static void
char finally long strictfp volatile
class float native super while
const for new switch
continue goto package synchronized
"Thanks to Indian media who has over the period of time swiped out intellectual taste from mass Indian population." - Chetan Parekh
Originally posted by ravish kumar:
Thses are only Keywords define by JLS:
true, false, null are neither KEYWORD nor RESERVED words.
true - booloean litral
fasle- booloean litral
null - null litral
there are only 2 reserved words : goto & const which are KEYWORDS also.
reserved are words that are not used by java and can not be used as identifier. they are here to help programmer who migrate from C background.
kumar ]
Rob
SCJP 1.4
Originally posted by John Lynn:
I found this handy set of 4 science fiction-like sentances to help remember the java reserved words:
1. Abstract native try break default interface while byte finally throws
public case for do
2. super short volatile private synchronized this final return continue
throw long char
3. if long protected static continue float Boolean extends strictfp else
implements void instanceof int
4. const goto class catch new transient package import double protected
switch
Rob
SCJP 1.4
Originally posted by John Lynn:
I found this handy set of 4 science fiction-like sentances to help remember the java reserved words:
1. Abstract native try break default interface while byte finally throws
public case for do
2. super short volatile private synchronized this final return continue
throw long char
3. if long protected static continue float Boolean extends strictfp else
implements void instanceof int
4. const goto class catch new transient package import double protected
switch
Nice to meet you here. I like Java.
Rob
SCJP 1.4
Originally posted by Rob Ross:
Ravish, not true.
A reserved word is a sequence of characters that obeys the rules of a lexical identifier, but that the compiler will prevent you from using as an identifier for your own objects; ie, you cannot use a reserved word to name your variables, classes, interfaces, etc, because the word has been reserved for use. All keywords are reserved. So are the lexical symbols 'null', 'true', and 'false'.
A keyword is a parsed token that invokes special semantic processing; it is semantically different than an identifier, and appears in your source code in positions that are syntactically distinct from an identifer.
The confusion I think comes because in the JLS section 3.9 states:
Keywords
"The following character sequences, formed from ASCII letters, are reserved for use as keywords and cannot be used as identifiers (3.8) ...(long list omitted)... The keywords const and goto are reserved, even though they are not currently used...While true and false might appear to be keywords, they are technically Boolean literals. Similarly, while null might appear to be a keyword, it is technically the null literal"
For the purpses of the SCJP, they are not going to ask you to understand the differences between keywords and reserved words. The questions will be "which are reserved words in java?"
People should *stop* using the term "keyword" because in the majority of instances, they are using it incorrectly.
Rob
[ January 23, 2002: Message edited by: Rob Ross ]
[ January 23, 2002: Message edited by: Rob Ross ]
Rob
SCJP 1.4
Originally posted by Rob Ross:
Yes, null is a reserved word.-- WRONG
true is a reserved word -- WRONG
false is a reserved word -- WRONG
all the java keywords are also reserved words. -- WRONG
Rob
"Thanks to Indian media who has over the period of time swiped out intellectual taste from mass Indian population." - Chetan Parekh
"Thanks to Indian media who has over the period of time swiped out intellectual taste from mass Indian population." - Chetan Parekh
The following character sequences, formed from ASCII letters, are reserved for use as keywords and cannot be used as identifiers (�3.8):
Keyword: one of
abstract default if private this
boolean do implements protected throw
break double import public throws
byte else instanceof return transient
case extends int short try
catch final interface static void
char finally long strictfp volatile
class float native super while
const for new switch
continue goto package synchronized
Rob
SCJP 1.4
"Thanks to Indian media who has over the period of time swiped out intellectual taste from mass Indian population." - Chetan Parekh
"Thanks to Indian media who has over the period of time swiped out intellectual taste from mass Indian population." - Chetan Parekh
"Thanks to Indian media who has over the period of time swiped out intellectual taste from mass Indian population." - Chetan Parekh
SCWCD: Online Course, 50,000+ words and 200+ questions
http://www.examulator.com/moodle/course/view.php?id=5&topic=all
Rob
SCJP 1.4
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |