Keywords

Java has several keywords. You should avoid giving classes, methods, or variables the same names as these keywords. You've already seen several of them, but for completeness, here are several of the common keywords:

abstract static break
native class if
volatile interface else
public for do
private default while
protected void switch
synchronized return case
instanceof package continue
final import  

Note

Java has the keyword goto , but it is merely reserved. It is not implemented, so you cannot use goto yourself for anything, nor can you, thankfully, use goto in your code.

Get PURE Java™ 2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.