I have one doubt regarding keywords.In one of the mock exam I observed that "true" is not a keyword.I have searched in K & B book also,there it does'nt list true as a keyword. I have another doubt.Is this acceptible Boolean flag=true;
As Steinar already pointed out, true and false are boolean literals, not keywords. Similarly, null is also a special literal, known as the (surprise!) "null literal". Despite their lexical structure, you should think of them in the same way as other literals like 42, -.287f, and "Hello, World!".
However, this restriction is really just a technical detail that's important only to people who work on parsers and conceptualize Java grammar rules. For all practical purposes, the restrictions on what you can do with true and false are the same as the restrictions for keywords. [ November 15, 2007: Message edited by: Kelvin Lim ]