Keywords in JAVA

Keywords are the reserved words in java. They cannot be use to name variables, constants, classes, objects, methods etc… There are 50 keywords in java.

abstract
assert
boolean
break
byte
case
catch
char
class
const
continue
default
do
double
else
enum
extends
final
finally
float
for
goto
if
implement
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



In addition to above keywords, java reserves following words: true, false and null. These values are defined by java. So you can’t use true, false and null for names of variables, classes and so on.

No comments: