Reserved Words In java
The list of reserved words in Java is provided below.
Some identifiers are reserved to associate some functionality or to represent values, such type of reserved identifiers are called “Reserved Words
byte
short
int
long
float
double
char
boolean
else
switch
case
default
do
while
for
break
continue
return
Reserved Words
Some identifiers are reserved to associate some functionality or to represent values, such type of reserved identifiers are called “Reserved Words
Keywords for Datatypes
byte
short
int
long
float
double
char
boolean
Keywords for FlowControl
ifelse
switch
case
default
do
while
for
break
continue
return
Keywords for ExceptionHandling
try
catch
finally
throw
throws
assert
Keywords for Modifers
public
private
protected
final
abstract
static
native
synchronized
volatile
transient
strictf
Class Related Keyword
class
interface
package
extends
implements
import
Object Related Keywords
new
instanceof
super
this
void return type Keywords
if a method doesn’t return anything compulsory that method should be with void return type
UnUsed Keywords
goto -in java usage is considered as harmful.
const - alternatively we should use final keyword.
Enum Keyword
This keyword has introduced in 1.5 version, to define user defined data types.
Reserved Literals
(true,false)- Allowed values for boolean data types
null -Default value for object reference
Which of the following are valid java Reserved words ?
1) int, float, signed, double - (Wrong)
2) abstract, final, volatile, virtual - (Wrong)
3) new, delete - (Wrong)
4) goto, constant, static - (Wrong)
5) byte, short, int, long -(Right)
Note: All reserved words in java contain only lower case alphabet symbols.