The Java programming language has total of 50
reserved keywords which have special meaning for the compiler and cannot be
used as variable names. Following is a list of Java keywords in alphabetical
order, click on an individual keyword to see its description and usage example.
abstract
|
assert
|
boolean
|
break
|
byte
|
case
|
catch
|
char
|
class
|
const
|
continue
|
default
|
do
|
double
|
else
|
enum
|
extends
|
final
|
finally
|
float
|
for
|
goto
|
if
|
implements
|
import
|
instanceof
|
int
|
interface
|
long
|
native
|
new
|
package
|
private
|
protected
|
public
|
return
|
short
|
static
|
strictfp
|
super
|
switch
|
synchronized
|
this
|
throw
|
throws
|
transient
|
try
|
void
|
volatile
|
while
|
Some noteworthy points regarding Java
keywords:
- const and goto are resevered words but not used.
- true, false and null are literals, not keywords.
- all keywords are in lower-case.
The following table shows the keywords
grouped by category:
Categorys
|
Keyword
|
Access modifiers
|
private, protected, public
|
Class, method, variable modifiers
|
abstract, class, extends, final,
implements, interface, native,
new, static, strictfp, synchronized,
transient, volatile
|
Flow control
|
break, case, continue, default,
do, else, for, if, instanceof,
return,switch, while
|
Package control
|
import, package
|
Primitive types
|
boolean, byte, char, double,
float, int, long, short
|
Error handling
|
assert, catch, finally, throw,
throws, try
|
Enumeration
|
enum
|
Others
|
super, this, void
|
Unused
|
const, goto
|
Output111 Karan
222 Aryan
Output111 Karan 222 Aryan
No comments:
Post a Comment