DEV Community

Adeyemi Raji
Adeyemi Raji

Posted on

Java keywords you should know

In Java, there are several keywords that have a specific meaning in the language and cannot be used as identifiers (i.e., names of variables, methods, classes, etc.). Here is a list of the Java keywords:

abstract
continue
for
new
switch
assert
default
goto
package
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
finally
long
strictfp
volatile
const
float
native
super
while

Note that null, true, and false are not keywords, but they are reserved literals in Java and cannot be used as identifier names.

Top comments (0)