Reserved words:
· In java some identifiers are reserved to associate some functionality or meaning such
type of reserved identifiers are called reserved words.


Reserved words for data types:
1) byte
2) short
3) int
4) long
5) float
6) double
7) char
8) boolean
Reserved words for flow control:
1) if
2) else
3) switch
4) case
5) default
6) for
7) do
8) while
9) break
10) continue
11) return
Keywords for modifiers:
1) public
2) private
3) protected
4) static
5) final
6) abstract
7) synchronized
8) native
9) strictfp(1.2 version)
10) transient
11) volatile
Keywords for exception handling:
1) try
2) catch
3) finally
4) throw
5) throws
6) assert(1.4 version)
Class related keywords:
1) class
2) package
3) import
4) extends
5) implements
6) interface
Object related keywords:
1) new
2) instanceof
3) super
4) this

Void return type keyword:
· If a method won’t return anything compulsory that method should be declared with the
void return type in java but it is optional in C++.

1) void
Unused keywords:
goto: Create several problems in old languages and hence it is banned in java.
Const: Use final instead of this.
· By mistake if we are using these keywords in our program we will get compile time
error.
Reserved literals:
1) true values for boolean data type.
2) false
3) null----------------- default value for object reference.
Enum:
· This keyword introduced in 1.5v to define a group of named constants
Example:
enum Beer
{
KF, RC, KO, FO;
}
Note: All reserved words in java contain only lowercase alphabet symbols.
New keywords are:
Strictfp-----------1.2
Assert-------------1.4
Enum--------------1.5
SHARE

About df

    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment