Tokens are the basic building of language . A token is the smallest element of a program that is meaningful to the compiler. We write our program include these tokens. Tokens are the various Java program elements which are identified by the compiler. A token is the smallest element of a program that is meaningful to the compiler. Tokens supported in Java include keywords, variables, constants, special characters, operations etc.
- Keywords: Reserved keywords are java tokens with predefined meaning. There are 50 There are 50 keywords in java reserved keywords in java.
- Identifiers: Identifier refers the name for the class, array, inheritance and etc. Identifier are name for the class, name for member of the class , and temporary variable in class methods.
- Literals/Constants: Literrals are used to represent a constant that has to be stored in a variable.
- Operators: Operators can be used with one or more operands to achieve a result.
- Separators: Separators are used to divide as well as arrange code in group.