Author
Is "false" a keyword in java
Yu Fei Xu
Greenhorn
Joined: Mar 15, 2006
Posts: 8
I don't know is "false" a keyword in java ,please help me!thranks
Dan Patterson
Greenhorn
Joined: Jan 27, 2005
Posts: 24
true, false, and null are not keywords but they are reserved words, so you cannot use them as names in your programs.
Kj Reddy
Ranch Hand
Joined: Sep 20, 2003
Posts: 1697
false is not keyword, but its a reserved word.
Thibault Dangr�aux
Greenhorn
Joined: Dec 12, 2005
Posts: 19
Isn't it a litteral actually? With "false" representing the value "false"?
Jim Yingst
Wanderer
Sheriff
Joined: Jan 30, 2000
Posts: 18670
Yes, it's a literal - and also reserved. Same for true and null.
"I'm not back." - Bill Harding, Twister
Tony Morris
Ranch Hand
Joined: Sep 24, 2003
Posts: 1608
posted Mar 15, 2006 15:50:00
0
To draw an analogy, is 7 a keyword? No, it's an int literal. By the same reasoning, false is not a keyword, but a boolean literal.
Tony Morris
Java Q&A (FAQ, Trivia)
subject: Is "false" a keyword in java