Sunday, 26 September 2010

Keywords in java

Reserved words are words that can't be used as identifiers. Many of them are keywords that have a special purpose in Java.

abstractbooleanbreakbytecasecatch
charclassconstcontinuedefaultdo
doubleelseextendsfinalfinallyfloat
forgotoifimplementsimportinstanceof
intinterfacelongnativenewnull
packageprivateprotectedpublicreturnshort
staticstrictfpsuperswitchsynchronizedthis
throwthrowstransienttryvoidvolatile
whileassertenum


A literal in Java technology denotes a constant value. So for example 0 is an integer literal, and
It is important to note the following
  1. const and goto are not currently in use.
  2. null, true, and false are reserved literals but can be considered as reserved words for the purpose of exam.
  3. It is important to understand that Java language is case-sensitive. So even though super is a keyword, Super is not.
  4. All the Java technology keywords are in lower case.
  5. strictfp is a new keyword added in Java 1.2. assert is added in Java 1.4 and enum in Java 5.0

No comments:

Post a Comment