-
Book Overview & Buying
-
Table Of Contents
Learn Java 17 Programming - Second Edition
By :
The keywords are the words that have particular meaning for a compiler and cannot be used as identifiers. As of Java 17, there are 52 reserved keywords, 5 reserved identifiers, 3 reserved words, and 10 restricted keywords. The reserved keywords cannot be used as identifiers anywhere in the Java code, while the restricted keywords cannot be used as identifiers only in the context of a module declaration.
The following is a list of all Java-reserved keywords:
By now, you should feel at home with most of the preceding keywords. By way of an exercise, you can go through the list and check how many of them you remember. Up until now, we have not discussed the following eight keywords:
const and goto are reserved but not used, so far.assert keyword is used in an assert statement (we will talk about this in Chapter 4, Exception Handling).synchronized keyword is used in concurrent...