Computer Science, asked by kanojia3, 1 year ago

what is java tokens and with examples


anuj: KILPO

Answers

Answered by Anonymous
8
the smallest indiuiduals unit is known as tokens they are 5 types
identifiers
literals
operators.
keywords
punctuator
Answered by Anonymous
6
Java tokens are also called as lexical issues. Java is a collection of whitespaces, identifiers, literals, comments, operators, separators and keywords. These are called token of java.

1. White spaces: Ex: tab, space bar. These are used to give spaces.

2. Identifiers: These are the symbolic names given for variables, class or functions by the user.
Ex: Aclass, object1

3. Keywords: These are also called reserve words which convey a special meaning to the compiler.
Ex: class, public, void, switch, if, int etc

4. Constants: These are the data items which do not change its value during the execution of a program.
Ex: 200, 78.3, 'x' , "Rakesh"

5. Comments: These are the remarks from the programmer about the program.
Ex: //This program is to add two numbers

6. Separators: These are used to separate variables, statements etc.
Ex: ( ), { }, ; etc
 
7. Operators: An operator is a symbol or letter which performs a specific operation.
Ex: +, -, ++, - - etc  

Similar questions