File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Is Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Is "false" a keyword in java" Watch "Is "false" a keyword in java" New topic

Is "false" a keyword in java

Yu Fei Xu

Joined: Mar 15, 2006
Posts: 8
I don't know is "false" a keyword in java ,please help me!thranks
Dan Patterson

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: 1704
false is not keyword, but its a reserved word.
Thibault Dangr�aux

Joined: Dec 12, 2005
Posts: 19
Isn't it a litteral actually? With "false" representing the value "false"?
Jim Yingst

Joined: Jan 30, 2000
Posts: 18671
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
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)
I agree. Here's the link:
subject: Is "false" a keyword in java
It's not a secret anymore!