Tokens in Java

Table of Contents

Tokens in Java

What is a Token?

It is the smallest and basic grouped element in a Java Program is called as Tokens.
The compiler uses these tokens as a symbol to identify the code, and these tokens also help to maintain the syntax of the code.  
So following are the list of tokens that are considered:

  1. Identifiers: Names that the programmer chooses
  2. Keywords: Predefined Names in the programming language
  3. Separators (also known as punctuators): Characters used for punctuation and paired-delimiters
  4. Operators: Symbols that operate on operand and produces results
  5. Literals (specified by their type)
    • Numeric: int and double
    • Logical: boolean
    • Textual: char and String
    • Reference: null
  6. Comments

    • Line
    • Block

Next Identifiers in Java

Leave a Reply