Thursday, 23 February 2017

Java Reseved Keywords

Java Reseved Keywords

Keywords are identifiers like public, static and class that have a special meaning inside Java source code and outside of comments and Strings. Four keywords are used in Hello World, public, static, void and class.
Keywords are reserved for their intended use and cannot be used by the programmer for variable or method names.
There are fifty reserved keywords in Java 1.1, 51 in Java 1.2, 52 in Java 1.4, and 54 in Java 5. The forty-eight that are actually used in are listed below. Don't worry if the purposes of the keywords seem a little opaque at this point. They will all be explained in much greater detail later.

Keywords Used in Java

abstract continue for new switch
assert default goto packege synchronized
boolean do if private this
break double implements protected throw
byte else import public throws
case enum instanceof return transient
catch extends int short try
char final interface static void
class finaly long strictfp volatile
const float native super while

Note:- true and false appear to be missing from this list. In fact, they are not keywords but rather boolean literals. You still can't use them as a variable name though.

 Next Topic Shahbaz


Post a Comment

Powered by Blogger.