Configuration

Night mode

Java Syntax

Java Syntax Course

Engineers From These Top Companies and Universities Trust EXLskills

1M+ Professionals | 100+ Institutions

This is the EXLskills free and open-source Java Syntax Micro Course. It guides learners via explanation, demonstration, and thorough practice, from no more than a basic understanding of Java, to a moderate level of understanding regarding Java syntax.

Is this course FREE?

Yes, this a 100% free course that you can contribute to on GitHub here!

Have more questions?

Basic Syntax

Reserved words

In Java, there are keywords that are reserved for the use of Java functions or other uses that cannot be identifiers like variables, classes and function names. When a reserved word is used as a variable, we will get an error or some other unexpected result. Examples of reserved words are shown below.

In our example above, we see that the reserved words are in a different color than the rest of the line. These are words that have a specific meaning to the system. For example, class means that a definition of "class" immediately follows. We must use reserved words only for their intended purpose; we cannot use "class" for any other purpose than defining class.

Please notice that the Java reserved word must be written in the exact same way as Java states, including the case of the word. For this reason, even though it is not recommended, we could technically name a variable "Class" because the 'C' is capitalized so it is not our reserved word class.