Site icon TestingDocs.com

Java Tokens

Overview

Java tokens are the smallest elements in the Java program. Java Compiler identifies tokens as the basic building blocks of the program. The compiler breaks program statements into Java tokens.

Java Tokens

Java supports five types of tokens. They are as follows:

Keywords

Keywords have a predefined meaning and purpose in the Java language syntax. We cannot use keywords as variables or identifiers because they already have a predefined meaning in the language syntax.

Identifiers

Identifiers are names of specific programming elements such as variables, methods, classes, etc. To declare an identifier we have to follow some rules.

Literals

A literal is a constant value in Java. Literals are categorized as integer literal, floating-point literal, character literal, string literal, and boolean literal.

Operators

An operator is a symbol instructing the Java compiler to perform a specific action on one or more operands.

Separators

Separators are the special symbols that indicate where code blocks are separated and arranged.  Some of the separators are as follows:

Java Tutorials

Java Tutorial on this website:

https://www.testingdocs.com/java-tutorial/

For more information on Java, visit the official website :

https://www.oracle.com/java/

Exit mobile version